Skip to content

Commit 9776d05

Browse files
committed
feat: 70. Climbing Stairs
1 parent 1278bc0 commit 9776d05

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

climbing-stairs/HodaeSsi.py

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

0 commit comments

Comments
 (0)