Rate chases Cheese


where am i going wrong?

hello @dare_devil_007 i have modified your approach ,logic and now it is printing the correct answer .


if you have any query you can ask here ,we will discuss.
Happy Learning !!

actually we can travel in 4 directions as per the question, that is what i did in my code?
could you please check once again and make changes where i have done wrong in my code itself so that i know where i went wrong

@dare_devil_007 that is the thing what you are doing wrong four directions doesnt mean that you have to check for all fiiur directions but you have to check if we can move in the right direction or not if we cant move in the right then we have backtrack and we have to go to the left and if we are backtracking then it isautomatically going to the left and the same is with down and up i.e we have to try for down direction and if we cant move down then we have to backtrack and in backtracking it will automatically move in up direction .
i hope you have understood your mistake and if you still have doubt you can ask here .
Happy Learning !!

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.