Count board path

how does the process take place in staack in this count problem.

@malhotranaman83,

I will take the example in the video.
Say we have to go from 7 to 10. Now inorder to go from 7 to 10, we will first go from 8 to 10. Inorder to get all possible combinations for 8 to 10, we will get combinations from 9 to 10. 9 to 10 is simple. Just add 1 to 9. Hence 1 way is possible… Now we return this 1 (backtrack) to the ways we have in which we can go from 8 to 9. Similarly we can go directly from 8 to 10 by adding 2. So we return the number of ways to get from 8 to 10 as 2. Now this is how the recursive loop goes on.

1 Like

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.