LeetCode Best Time to Buy and Sell Stock II
原题链接在这里:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
是Best Time to Buy and Sell Stock的进阶版,但思路去不太相同。
这里可以进行无数次交易,当然不能比prices.length - 1还多,就是每次股票比前一天差价大于0都进行交易,把这些大于0的差价相加就是最后返回的结
原创
2015-09-16 02:27:35 ·
441 阅读 ·
0 评论