You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1
Input: n = 8
Output: 34
Explanation: The ways to reach step n equal the ways to reach step n - 1 (then take 1 step) plus the ways to reach step n - 2 (then take 2 steps). Counting up from 1 step: 1, 2, 3, 5, 8, 13, 21, 34, so there are 34 ways to reach step 8.
Example 2
Input: n = 2
Output: 2
Explanation: There are two ways to climb 2 steps: 1 + 1, or a single 2-step jump.
Example 3
Input: n = 3
Output: 3
Explanation: There are three ways to climb 3 steps: 1 + 1 + 1, 1 + 2, and 2 + 1.
The recurrence `f(n) = f(n-1) + f(n-2)` only ever depends on the *previous two* values. So instead of an array `dp[0..n]` we just keep two scalars and slide them forward.
Run checks all cases above. Submit evaluates all test cases.