Skip to content

Commit 5eb168e

Browse files
committed
update
1 parent 57f30b2 commit 5eb168e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

code/746.使用最小花费爬楼梯.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# @lc code=start
88
class Solution:
99
def minCostClimbingStairs(self, cost: List[int]) -> int:
10-
10+
m1 = cost[1]
11+
m2 = min([m1, cost[0]])
12+
for c in cost[2:]:
13+
m2, m1 = min([m2 + c, m1]), m2 + c
14+
return m2
1115
# @lc code=end
12-

0 commit comments

Comments
 (0)