删减了309一维数组空间优化的部分注释

This commit is contained in:
LiHua
2021-11-25 21:31:13 +08:00
parent b18f227ffb
commit 1f33812b15

View File

@ -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++){