Rat in a maze. test cases not passing



my answer is wrong.
please help.

Hello @ankitdelhi20,

I have modified your code:


Refer to the comments for better understanding.

Hope, this would help.
Give a like, if you are satisfied.

thanks! It worked.

@ankitdelhi20 Anytime.

Please, mark this doubt as resolved.
BTW, I won’t mind a like.:wink: