5 lines
173 B
Python
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) |