From 1f33812b15367fc21c9498d77f286d4633d3a137 Mon Sep 17 00:00:00 2001 From: LiHua <1985390347@qq.com> Date: Thu, 25 Nov 2021 21:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E5=87=8F=E4=BA=86309=E4=B8=80?= =?UTF-8?q?=E7=BB=B4=E6=95=B0=E7=BB=84=E7=A9=BA=E9=97=B4=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0309.最佳买卖股票时机含冷冻期.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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++){