public static int maxProfit2(int[] prices) {
		BestTimetoBuyandSellStockIII main = new BestTimetoBuyandSellStockIII();
		Queue<Integer> profitQueue = new PriorityQueue<Integer>(1000,
				main.new OwnComparator());
		Stack<Integer> stack = new Stack<Integer>();
		int lowPos = 0;
		int tempLowPos = 0;
		int highPos = 0;
		int max = 0;
		boolean continueSeq = false;
		for (int i = 0; i < prices.length; i++) {
			if (prices[i] < prices[lowPos]) {
				lowPos = i;
				tempLowPos = i;
			}
			int diff = prices[i] - prices[lowPos];
			if (diff > max) {
				max = diff;
				// highPos = i;
				if (continueSeq) {

				}
				if (i + 1 < prices.length && prices[i + 1] < prices[i]) {

				}
			}
		}

		if (max <= 0) {
			return 0;
		} else {
			max = profitQueue.poll();
			if (profitQueue.peek() != null)
				max += profitQueue.poll();
			return max;
		}
	}