修正【0122-买卖股票的最佳时机II.md】javaScript代码
This commit is contained in:
parent
a842d1fffb
commit
0ecc3bd7cf
|
|
@ -264,7 +264,7 @@ const maxProfit = (prices) => {
|
||||||
dp[i][1] = Math.max(dp[i-1][1], dp[i-1][0] + prices[i]);
|
dp[i][1] = Math.max(dp[i-1][1], dp[i-1][0] + prices[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dp[prices.length -1][0];
|
return dp[prices.length -1][1];
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue