diff --git "a/leetcode3/\354\265\234\354\233\220\354\244\200/746. Min Cost Climbing Stairs.py" "b/leetcode3/\354\265\234\354\233\220\354\244\200/746. Min Cost Climbing Stairs.py" new file mode 100644 index 00000000..07469201 --- /dev/null +++ "b/leetcode3/\354\265\234\354\233\220\354\244\200/746. Min Cost Climbing Stairs.py" @@ -0,0 +1,7 @@ +class Solution: + def minCostClimbingStairs(self, cost: list[int]) -> int: + cost.append(0) + n = len(cost) + for i in range(2,n): + cost[i] += min(cost[i-2], cost[i-1]) + return cost[-1]