Rat in a maze base case doubt

In the n queens problem while printing all the solutions, in the base case we returned false so that it continues to look for more solutions, when we returned true it only printed one solution.

However in rat in maze problem, in the base case we returned true not false, then why was it printing all the solutions. Why did it still continue to look for more solutions when we returned true in the base case.

Hi

do not ever compare code like this : in one code true se print one hua and other many were printed.

check the complete code,
even if you have true in base case of rat in maze you are print all ans coz of the recursive calls to left and right, you are returning true after calling both the left and right , if you want one solution don not place true after calling both , place true as soon as any one is true ( i mean after right check if it returned true or not if yes then do not call the other part)

placing true after both calls allows you to search all the possibilities

Paste link of your code, i’ll make changes if you are not able to get my point, or contact me on 8750354215

Hit like if you get it!
Cheers!

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.