Rat in a Maze Problem

What if multiple solutions exist??

you need to report rightmost path. this can be handled if you first check for (i,j+1)th position and then for (i+1,j)th position.

But in given Question there are 3 solutions. But in test case only 1 is mentioned. Any other conditon have to happly??

Ashwani if you use rightmost path it is always unique!

https://ide.codingblocks.com/s/237294 How do I get rightmost path ?? Its showing all the path that can be possible


you should return true whenever you find a possible answer so that further calls are skipped! If your doubt is clear, mark it as resolved.

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.