Getting garbage value ,please check my code:
Rat in maze (Backtracking )
Have just run a for loop of I & j to make sure that all index of soln is equal to zero.
2 test cases not passed and Getting TLE
Updated code, getting accepted and have commented your error
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.
I have handled it in code already
line no-42
if(rightSuccess || downSuccess){
return true;
}.
Then why it needs to add agaign.
as the nature of the problem is first we will check if there’s any right block on which we can iterate and if it does then only we check for down column cause output format are arranged in that manner only, so have checked it just to avoid any mistake in output format rest your code was appropriate corresponding to problem statement.