package leetcode;

/**
 * https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
 */
public class Problem123 {
    public int maxProfit(int[] prices) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem123 prob = new Problem123();
    }
}

@@ -202,96 +202,568 @@
  %7D%0A%0A
-    public static void main(String%5B%5D args) %7B%0A        Problem123 prob = new Problem123();
+//    private static int maxProfit(int%5B%5D prices, int i) %7B%0A//        for (int j = i + 1; j %3C prices.length; j++) %7B%0A//            if (prices%5Bi%5D %3E prices%5Bj%5D) %7B%0A//                maxProfit(prices, j + 1);%0A//            %7D%0A//        %7D%0A//    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem123 prob = new Problem123();%0A        System.out.println(prob.maxProfit(new int%5B%5D%7B3, 3, 5, 0, 0, 3, 1, 4%7D)); // 6%0A        System.out.println(prob.maxProfit(new int%5B%5D%7B1, 2, 3, 4, 5%7D)); // 4%0A        System.out.println(prob.maxProfit(new int%5B%5D%7B7, 6, 4, 3, 1%7D)); // 0
 %0A   

Update problem 123