Test case 0 and 1 not passing

Please check why my code doesn’t pass test case 0 and 1 but passes 2 3 and 4

@Garvit012
In the question it is clearly mentioned that rat can move in all 4 directions. You just considered right and down direction. You have to add condition for up and left as well

oh sorry i must have misread the question due to a similar question in video

@Garvit012
It’s ok try to implement it. Mark this doubt as resolved, if you have no more doubt