代码随想录 day55 最佳买卖股票时机

最佳买卖股票时机含冷冻期

1. [i][0] holding the stock
2. [i][1] after cooldown but stil not buing the stock
3. [i][2] selling the stock
4. [i][3] cooldown

就是在Ⅱ的基础上加入了第三四个状态
这里必须分开 才能表示出冷冻期内不能交易

买卖股票的最佳时机含手续费


这里和Ⅱ区别不大 也就是在计算收益的时候要减去fee

posted @ 2024-02-19 21:16  又见鸣蜩  阅读(7)  评论(0)    收藏  举报