NO.9 week 10 Best time to Buy and Sell stock

来源:互联网 发布:js文件解压缩 编辑:程序博客网 时间:2024/06/01 21:45

1、Description


2.How to Solve

根据dynamic programming的思路,要想找到max profit,先找到当前买进价格对应的max profit,然后随着时间推移买进价格的变化,对应的max profit只有在买进价格变低的时候才会增大(假设同一天卖出)。


0 0
原创粉丝点击