Can anyone point out what is wrong with this code?
This gives WA in two test cases 
Rat in a Maze problem
Hi @googlerpratiik , your code is correct exept one small mistake that here you have to find the rightmost path that is you have to prioritize right over down
so, instead of
if(reaches(mat,solve,r+1,c,n,m))
return true;
else if(reaches(mat,solve,r,c+1,n,m))
return true;
do
if(reaches(mat,solve,r,c+1,n,m))
return true;
else if(reaches(mat,solve,r+1,c,n,m))
return true;
I have corrected your code here : - https://ide.codingblocks.com/s/200581
In case of any doubt feel free to ask
mark your doubt as resolved if you got the answer
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
