1 def minCostClimbingStairs2(self, cost): 2 """ 3 :type cost: List[int] 4 :rtype: int 5 """ 6 cost1 = cost2 = 0 7 for i in cost: 8 cost1, cost2 = i + min(cost1, cost2), cost1 9 return min(cost1, cost2)
1 def minCostClimbingStairs2(self, cost): 2 """ 3 :type cost: List[int] 4 :rtype: int 5 """ 6 cost1 = cost2 = 0 7 for i in cost: 8 cost1, cost2 = i + min(cost1, cost2), cost1 9 return min(cost1, cost2)