Log in to run or submit
Number of ways is Fibonacci: dp[i] = dp[i-1] + dp[i-2].
dp[i] = dp[i-1] + dp[i-2]
Iterate with two variables for O(1) space.