Best Time to Buy and Sell Stock

a[i] = a[i] - a[i - 1]
之后在a中求和最大的连续子序列
该子序列的和就是所求解