Skip to content

Commit 6966176

Browse files
committed
climbing stairs solution
1 parent 2a3568b commit 6966176

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

climbing-stairs/radiantchoi.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def climbStairs(self, n: int) -> int:
3+
stairs = [1, 1]
4+
5+
if n > 1:
6+
for i in range(2, n+1):
7+
stairs.append(stairs[i - 1] + stairs[i - 2])
8+
9+
return stairs[-1]
10+

0 commit comments

Comments
 (0)