Easy
Count how many ways to climb to the top taking 1 or 2 steps.
Each move can climb 1 or 2 stairs. Return the number of distinct ways to reach stair n.
Examples
Input: n = 3
Output: 3
Constraints
- 1 <= n
Coding Challenge
Count how many ways to climb to the top taking 1 or 2 steps.
Each move can climb 1 or 2 stairs. Return the number of distinct ways to reach stair n.
Input: n = 3
Output: 3
Preparing your coding workspace...