Skip to content

Commit

Permalink
309.最佳买卖股票时机含冷冻期 递推代码少了一个括号
Browse files Browse the repository at this point in the history
  • Loading branch information
Frogrey authored Jan 3, 2022
1 parent aaf8584 commit e3f8887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/0309.最佳买卖股票时机含冷冻期.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ p[i][3] = dp[i - 1][2];
综上分析,递推代码如下:

```CPP
dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][3], dp[i - 1][1]) - prices[i];
dp[i][0] = max(dp[i - 1][0], max(dp[i - 1][3], dp[i - 1][1]) - prices[i]);
dp[i][1] = max(dp[i - 1][1], dp[i - 1][3]);
dp[i][2] = dp[i - 1][0] + prices[i];
dp[i][3] = dp[i - 1][2];
Expand Down

0 comments on commit e3f8887

Please sign in to comment.