2019-01-26 08:34:45 +08:00

5 lines
173 B
Python

def minCostClimbingStairs(self, cost):
temp = [0, cost[0]]
for i in range(1, len(cost)):
temp[0], temp[1] = temp[1], min(temp) + cost[i]
return min(temp)