public static int maxProfit3(int[] prices) {
    	List<Integer> p = maxProfitPoint(prices, 0, prices.length);
    	int profit = p.get(2);
    	List<Integer> p1 = maxProfitPoint(prices, 0, p.get(0));
    	List<Integer> p2 = maxProfitPoint(prices, p.get(1) + 1, prices.length);
    	profit = profit + (p1.get(2) > p2.get(2) ? p1.get(2) : p2.get(2));
    	
    	for(int i = p.get(0) + 1; i < p.get(1); i++) {
    		List<Integer> left = maxProfitPoint(prices, p.get(0), i);
    		List<Integer> right = maxProfitPoint(prices, i, p.get(1) + 1);
    		if (left.get(2) + right.get(2) > profit) profit = left.get(2) + right.get(2); 
    	}
        return profit;
    }