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 fa8a2f3 commit 7f64711Copy full SHA for 7f64711
climbing-stairs/mangodm-web.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def climbStairs(self, n: int) -> int:
3
+ dp = [0] * (n + 1)
4
+ dp[0], dp[1] = 1, 1
5
+
6
+ for i in range(2, n + 1):
7
+ dp[i] = dp[i - 1] + dp[i - 2]
8
9
+ return dp[n]
0 commit comments