您当前的位置: 首页 > 

宝哥大数据

暂无认证

  • 2浏览

    0关注

    1029博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

123. 买卖股票的最佳时机 III

宝哥大数据 发布时间:2019-10-24 15:09:58 ,浏览量:2

123. 买卖股票的最佳时机 III 题目描述 在这里插入图片描述

错误的方法:此处我错误的考虑为连续的利润
class Solution:
    def maxProfit(self, prices: List[int]) -> int:    
        
        preProfit = 0
        profits = []
        for i in range(1, len(prices)):
            curProfit = prices[i] - prices[i-1]
            
            if curProfit > 0:
                if preProfit             
关注
打赏
1587549273
查看更多评论
0.1081s