We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bfced8 commit 13a5cdfCopy full SHA for 13a5cdf
climbing-stairs/do-heewan.py
@@ -0,0 +1,10 @@
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]
0 commit comments