Rat chases its cheese

2 testcases are not getting passed. Please help me to find the error.

the following is the code:-

hey @krikhi in your code rat is only going right and downward direction but as per problem statement it can go left and upward too,apply these cases too and you are good to go.

still one test case is not getting passed. The link of the code is:- https://ide.codingblocks.com/s/173704

@krikhi in line 33 when you are initializing bool left ,right,up and down initialize them by keeping equal to false then you are good to go.if still faces any problem inform me else please mark this doubt as resolved.thankyou.

Thank you so much :slight_smile:

1 Like

you are welcome…:slightly_smiling_face: