摘要: 121 买卖股票最佳时机 func maxProfit(prices []int) int { // dp五部曲 // 1 dp数组以及下标含义 dp[i][0] 表示第i天持有股票 dp[i][1] 表示第i天不持有 // 2 递推公式,dp[i][0] = max(dp[i-1][0], 0-p 阅读全文
posted @ 2024-08-26 11:04 周公瑾55 阅读(40) 评论(0) 推荐(0)