IN the given challenge we have to only print the rightmost path.So i tried doing it by keeping a global bool value called flag and setting it to false after printing the first solution(which will also be the rightmost since we have made right recursive call first) but i am getting wrong answer.How do i print only the rightmost path??
Rat Maze Backtarcking
@aryamaan1011
Inorder to print only one output what you need to do is just return if your rightsuccess is true. If rightsucess is true you need not to go in down direction. So simply write if(rightsuccess){ return true; } just after line 40.
Also increase size of sol[][] and maze[][] array to 1000*1000. All testcase will pass.