From e428019c31661a8ce5d74e77ddd9254f07d93094 Mon Sep 17 00:00:00 2001 From: Won Joon Thomas Choi <113500771+724thomas@users.noreply.github.com> Date: Fri, 2 Oct 2026 22:58:12 +0900 Subject: [PATCH] Create 746. Min Cost Climbing Stairs.py --- .../746. Min Cost Climbing Stairs.py" | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 "leetcode3/\354\265\234\354\233\220\354\244\200/746. Min Cost Climbing Stairs.py" 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]