Interesting point to note. Please correct me if wrong

When our current position is blocked by ‘X’ , we just want to return and donot want that branch of our recursive tree to continue. So program works even if return false is replaced by return true.
My code: https://ide.codingblocks.com/s/264152
Please correct me if I am wrong. Thank you

@girishgargcool the code you have written is printing all the possible path so it won’t matter if you return true or false you have to just return if path is blocked by ‘X’. in your code if you take your solve function as VOID and do not return anything simple wrote return; then also it will work. returning true or false will help you in the cases when you have to print only one path.

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.