Staircase Ways
You climb a staircase of n steps, taking 1 or 2 steps at a time. Return the number of distinct ways to reach the top.
The count satisfies with .
Constraints
Examples
EXAMPLE WALKTHROUGHtwo ways
A guided view of the published example, not a trace of your code.
INPUT
[2]TASKstaircase_ways()
EXPECTED OUTPUT
2Start with the input values shown in this example.
Example 1 of 3
Input: n = 2
Output: 2
Explanation: two ways
Input: n = 3
Output: 3
Explanation: three ways
Input: n = 0
Output: 1
Explanation: zero steps
Hint 1
You only need the previous two values, not the whole table.