A staircase has n steps. Starting below step 1, you may climb either 1 or 2 steps at a time. Return the number of distinct step sequences that reach exactly the top.
Input / output
n: integerExamples
n = 2 returns 2: 1+1 and 2.n = 5 returns 8.Constraints
1 <= n <= 45Follow-up Show why this recurrence is Fibonacci-like and reduce the dynamic-programming table to two variables.