Base case condition

Base case why not when row == n-1 && col == m-1 ?

@sahazeer123
It is essentially that only.
Look at the call made in main function.

bool ans = ratInMaze(maze, soln , 0, 0, m-1, n-1) ;

The m and n values working in recursive calls are actually one less than the m and n values in main().

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.