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 e470235 commit 49b8257Copy full SHA for 49b8257
problems/0070.爬楼梯完全背包版本.md
@@ -147,6 +147,23 @@ class Solution {
147
148
Python:
149
150
+```python3
151
+class Solution:
152
+ def climbStairs(self, n: int) -> int:
153
+ dp = [0]*(n + 1)
154
+ dp[0] = 1
155
+ m = 2
156
+ # 遍历背包
157
+ for j in range(n + 1):
158
+ # 遍历物品
159
+ for step in range(1, m + 1):
160
+ if j >= step:
161
+ dp[j] += dp[j - step]
162
+ return dp[n]
163
+```
164
+
165
166
167
168
Go:
169
0 commit comments