ques link - https://www.codechef.com/LTIME70B/problems/TRVLCHEF
my logic-
- First take the first element in a separate variable say x.
- now sort the n-1 elements.
- check if we can go to first element of the sorted array if yes then traverse the whole array, if we can reach the last element in the array then ans is yes otherwise check if we can go to the last element in the array from x, if yes traverse the array backwards if we can reach the first element then ans is yes otherwise no.
why is this incorrect? On what test case it will fail?