Skip to content

Commit 2bbec85

Browse files
committed
Create do-heewan.py
1 parent 49866af commit 2bbec85

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

climbing-stairs/do-heewan.py

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

0 commit comments

Comments
 (0)