Ladders Top Down Problem

when N=0 then how output can be 1 ??
As we are standing on ground floor so ans should be 0

hi @ashwani225 it basically depends on what base cases are you taking
if you define answer for n = 1 and n = 2 you can ignore that and take ans for n = 0 as 0

but you can also take n = 0 as 1 (no way can be considered a way)
and you can take base case for n = 1 accordingly.

See according to the recurrance relation base case should contain 2 values, so its upto you which values to define it for, it will give correct answer either way.

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.