public int maxProfit(int[] prices) { // only get profit >= 0
		int maxp = 0;
		int diff = 0;
		for (int i = prices.length - 2; i >= 0; i--) {
			if (diff >= 0)// accumulate if positive
				diff += prices[i + 1] - prices[i];
			else
				// diff is no more +=, which means it discarded the negative one
				diff = Math.max(0, prices[i + 1] - prices[i]);
			maxp = Math.max(diff, maxp);
		}
		return maxp;
	}