Climbing Stairs
Ways to reach step n = ways(n-1) + ways(n-2).
Cost
- Best
- O(n)
- Average
- O(n)
- Worst
- O(n)
- Space
- O(1)
Before this
Leads to
Topics that need this one first.
Taught by the same lesson
DP in One Row covers these too, in the same run.
Ways to reach step n = ways(n-1) + ways(n-2).
Topics that need this one first.
DP in One Row covers these too, in the same run.