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.
2 parents f9807f4 + 92e579f commit f06c0acCopy full SHA for f06c0ac
dart/0746-min-cost-climbing-stairs.dart
@@ -0,0 +1,9 @@
1
+class Solution {
2
+ int minCostClimbingStairs(List<int> cost) {
3
+ for (int i = cost.length - 3; i >= 0; i--) {
4
+ cost[i] += min(cost[i + 1], cost[i + 2]);
5
+ }
6
+
7
+ return min(cost[0], cost[1]);
8
9
+}
0 commit comments