public static int maxProfit2(int[] prices) {
		int lowPos = 0;
		int highPos = 0;
		int max = 0;
		for (int i = 0; i < prices.length; i++) {
			if (prices[i] < prices[lowPos])
				lowPos = i;
			int diff = prices[i] - prices[lowPos];
			if (diff > max) {
				max = diff;
				// highPos = i;
			}
		}
		if (max <= 0) {
			return 0;
		} else {
			return max;
		}
	}