diff --git a/problems/0309.最佳买卖股票时机含冷冻期.md b/problems/0309.最佳买卖股票时机含冷冻期.md index 8c6ab288..48106bd8 100644 --- a/problems/0309.最佳买卖股票时机含冷冻期.md +++ b/problems/0309.最佳买卖股票时机含冷冻期.md @@ -189,9 +189,8 @@ class Solution { // 一维数组优化 class Solution { public int maxProfit(int[] prices) { - // dp[2]和dp[3]用来存储冷冻期的数据 int[] dp=new int[4]; - // 0表示持有,1表示卖出 + dp[0] = -prices[0]; dp[1] = 0; for(int i = 1; i <= prices.length; i++){