JAVA_Min Cost Climbing Stairs_LeetCode 746 풀이 class Solution { public int minCostClimbingStairs(int[] cost) { for (int i = 2; i < cost.length; i ++) cost[i] += Math.min(cost[i - 1], cost[i - 2]); return Math.min(cost[cost.length - 1], cost[cost.length - 2]); } } * 출처 Min Cost Climbing Stairs - LeetCode Can you solve this real interview question? Min Cost Climbing Stairs - You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can eith...
#JAVA
#JAVA_LeetCode746
#JAVA_MinCostClimbingStairs
#JAVA_MinCostClimbingStairs_LeetCode746
#MinCostClimbingStairs_LeetCode746
원문링크 : JAVA_Min Cost Climbing Stairs_LeetCode 746