Line number 52.
if(low!=high)
Why? What will low and high be for 0?
Line number 52.
if(low!=high)
Why? What will low and high be for 0?
ok i removed that , bcoz earlier i didnt marked for zero movement robot, but getting wrong answer still after marking zero move for above code(21337330).I will not sleep untill i get AC
Array size is 50. Len is upto 50. \implies high upto 50. 0 based indexing. Max possible index allowed is 49. Still used \leq high. Try fixing that.
By making size of visited array 51 -> AC , but any ways earlier the size was 50 (1 less), how an visited array of size 1 less can give WA, can u think of such test case
Any ways thanks legend!!