摘要: 题目:121. 买卖股票的最佳时机 思路: 贪心做起来更简单;dp多此一举……状态0是持有,状态1是不持有 代码: func maxProfit(prices []int) int { lens := len(prices) if lens == 0 { return 0 } dp := make( 阅读全文
posted @ 2023-09-12 10:10 WtcSky 阅读(11) 评论(0) 推荐(0)