public static int maxProfit1(int[] prices) {
        if(prices.length <= 1) return 0;
        int max = partMax(prices, 0, prices.length - 1), min = -1;
        for(int i = 1; i < prices.length; i++){
        	if(prices[i] > prices[i - 1]){
        		if(min == -1) min = prices[i - 1];
        	} else {
        		if(min != -1){
        			int res = partMax(prices, 0, i - 1) 
        					+ partMax(prices, i, prices.length - 1);
        			if(res > max) max = res;
        			min = -1;
        		}
        	}
        }
    	return max;
    }