746. Min Cost Climbing Stairs
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
costs = [0] * (len(cost) + 1)
costs[0] = cost[0]
costs[1] = cost[1]
cost.append(0)
i = 2
while i < len(costs):
costs[i] = cost[i] + min(costs[i-1], costs[i-2])
i += 1
return costs[-1]