say you have an array for which the ith element is the price of a given stock on day i.
design an algorithm to find the maximum profit. you may complete at most two transactions.
note:
you may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).
建立两个数组<code>left</code>和<code>right</code>,分别存储某个元素左边和右边所能获得的最大收益。即<code>left[i]</code>存储从<code>[0, i]</code>范围的最大收益;<code>right[i]</code>存储从<code>[i, len - 1]</code>范围的最大收益。