package leetcode;

/**
 * https://leetcode.com/problems/min-cost-climbing-stairs/
 */
public class Problem746 {
    public int minCostClimbingStairs(int[] cost) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem746 prob = new Problem746();
        System.out.println(prob.minCostClimbingStairs(new int[]{10, 15, 20})); // 15
        System.out.println(prob.minCostClimbingStairs(new int[]{1, 100, 1, 1, 1, 100, 1, 1, 100, 1})); // 6
    }
}

@@ -168,15 +168,299 @@
     
-// TODO
+int%5B%5D dp = new int%5Bcost.length%5D;%0A        int min = 0;%0A        for (int i = cost.length - 1; i %3E= 0; i--) %7B%0A            int a = 0;%0A            if (i - 2 %3E= 0) %7B%0A                a = dp%5Bi - 2%5D;%0A            %7D%0A            int b = dp%5Bi - 1%5D;%0A            dp%5Bi%5D = cost%5Bi%5D + Math.min(a, b);%0A        %7D
 %0A   
@@ -471,17 +471,19 @@
  return 
-0
+min
 ;%0A    %7D%0A

Update problem 746