This problem is aim to find every increasing subsequence in list, and sum all the difference between the head and the tail of subsequence.
1 对于[1,2,3,4,5]的情况,按照code是prices[1] - prices[0] + prices[2] - prices[1] + prices[3] - prices[2] + prices[4] - prices[3],最后很多中间项是抵消了的,最终就是prices[4] - prices[0]
我这里还多设置一个变量lowPrice,其实没有必要设,只需要每次比较当前price和previous price就好了,大于就有profit,小于就没有
要注意这种特殊情况