We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84d0e29 commit c012b21Copy full SHA for c012b21
src/main/java/com/fishercoder/solutions/_746.java
@@ -29,9 +29,9 @@ public int minCostClimbingStairs(int[] cost) {
29
dp[0] = cost[0];
30
dp[1] = Math.min(cost[1], cost[0] + cost[1]);
31
for (int i = 2; i < cost.length; i++) {
32
- dp[i] = Math.min(dp[i-1] + cost[i], dp[i-2] + cost[i]);
+ dp[i] = Math.min(dp[i - 1] + cost[i], dp[i - 2] + cost[i]);
33
}
34
- return Math.min(dp[cost.length-1], dp[cost.length-2]);
+ return Math.min(dp[cost.length - 1], dp[cost.length - 2]);
35
36
37
0 commit comments