From 2e745e0d9bb5edfd4f154fdfb2e5a3dfcfe6f5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=97=BC=ED=98=9C=EC=A0=95?= <122238744+cyzlcyzl@users.noreply.github.com> Date: Fri, 2 Oct 2026 23:37:23 +0900 Subject: [PATCH] Create 746. Min Cost Climbing Stairs.java --- .../746. Min Cost Climbing Stairs.java" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "leetcode3/\354\227\274\355\230\234\354\240\225/746. Min Cost Climbing Stairs.java" diff --git "a/leetcode3/\354\227\274\355\230\234\354\240\225/746. Min Cost Climbing Stairs.java" "b/leetcode3/\354\227\274\355\230\234\354\240\225/746. Min Cost Climbing Stairs.java" new file mode 100644 index 00000000..aab39060 --- /dev/null +++ "b/leetcode3/\354\227\274\355\230\234\354\240\225/746. Min Cost Climbing Stairs.java" @@ -0,0 +1,16 @@ +// dp +// o(n) + +class Solution { + public int minCostClimbingStairs(int[] cost) { + int[] dp = new int[cost.length + 1]; + + dp[0] = 0; + dp[1] = 0; + + for (int i = 2; i