Skip to content

Commit 2913d8d

Browse files
refactor 746
1 parent a2b0f9c commit 2913d8d

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-1
lines changed

src/main/java/com/fishercoder/solutions/_746.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class Solution1 {
2727
public int minCostClimbingStairs(int[] cost) {
2828
int[] dp = new int[cost.length];
2929
dp[0] = cost[0];
30-
dp[1] = Math.min(cost[1], cost[0] + cost[1]);
30+
dp[1] = cost[1];
3131
for (int i = 2; i < cost.length; i++) {
3232
dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);
3333
}

0 commit comments

Comments
 (0)