Problem 3154 · Hard

Find Number of Ways to Reach the K-th Stair

Memoise the state (stair, jump, down allowed); above stair k plus one no path can return, so those states contribute nothing.

Open the interactive visualisation