Doubt related get board in recursion

In get board path problem, I want you to please explain after it will hit the base case how the for loop will work ?

Hi @Mansi,
Can you please share a code for the query that you have?

https://ide.codingblocks.com/s/149702 in this after it hits the base case how the loop is working ?

Heyy @Mansi,
See this code: https://ide.codingblocks.com/s/149717
You only need to put your answer in arraylist when curr==end. I am printing but you can put it in an arraylist and return your answer.

This is a much simpler approach to understand. Check line 21 and see the check conditions in the for loop. Also, the break condition in such questions is when the current==end. Because if you go beyond, we will get incorrect answer.

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.