Skip to content

Commit

Permalink
Merge pull request youngyangyang04#986 from Frogrey/patch-1
Browse files Browse the repository at this point in the history
309.最佳买卖股票时机含冷冻期 递推代码少了一个括号
  • Loading branch information
youngyangyang04 authored Jan 7, 2022
2 parents 96a1884 + e3f8887 commit c9fc0cb
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 @@ -93,7 +93,7 @@ dp[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 c9fc0cb

Please sign in to comment.