What is the use of statements after sol[i][j]=0;?

i am bit confused why we did that if statement?

hello @namanmittal0007

when we came to state ( i,j ) then we marked it 1. to indicate that we have come through this way.

but when we r going back to previous state it is our responsibility to mark the state (i,j) as 0 (i,e treat the current state as unexplorered)

no, i was asking about the statement after this statement. i was having doubt with the if(){return true statement } after this

pls paste the code snippet , in which u r having doubt

if( rightsuccess || downsuccess ){
retrun true;
return false;

here we r checking whether we have found any valid path or not.
if we have found any then we are returning true
otherwise we r returning false

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.