Broken Stairs
You climb from step 0 to step n, moving one or two steps at a time. The steps listed in broken cannot be stepped on. Return the number of ways to reach step n. If step n itself is broken, the answer is 0.
Example 1
n 5
broken [2]
returns 2
Two ways: 1+2+2 (steps 1, 3, 5) and 1+2+1+1 (steps 1, 3, 4, 5).
Constraints
1 <= n <= 15brokenhas distinct values between 1 andn
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.