We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9807f4 commit 92e579fCopy full SHA for 92e579f
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