← All problems
Climbing Stairs
EasyDP
You can climb 1 or 2 stairs at a time. In how many distinct ways can you climb n stairs?
Examples
Input: n = 2
Output: 2
Input: n = 3
Output: 3
Input: n = 5
Output: 8
Hints
Solution
Language:
Loading editor…
Output0 lines
Run your code to see output here.
Click Run all tests to check your solution against 5 test cases.