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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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