Update 0714.买卖股票的最佳时机含手续费(动态规划).md

This commit is contained in:
Qi Jia
2021-07-09 22:13:43 -07:00
committed by GitHub
parent 1c583ae1df
commit 69e54d9091

View File

@ -155,7 +155,7 @@ Go
Javascript Javascript
```javascript ```javascript
const maxProfit5 = (prices,fee) => { const maxProfit = (prices,fee) => {
let dp = Array.from(Array(prices.length), () => Array(2).fill(0)); let dp = Array.from(Array(prices.length), () => Array(2).fill(0));
dp[0][0] = 0 - prices[0]; dp[0][0] = 0 - prices[0];
for (let i = 1; i < prices.length; i++) { for (let i = 1; i < prices.length; i++) {