Ladders problem recursion

why do we need to take k??
and what means n=4 and k=3 in this problem??

@Ambuj-Singh-514796906079795 this means the no of ways to reach step n from n-1 , n-2 upto n-k (n=4 and k=3)
sorry for the late reply your doubt got missed by me due to some tech error

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.