mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
Update 0714.买卖股票的最佳时机含手续费(动态规划).md
This commit is contained in:
@ -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++) {
|
||||||
|
Reference in New Issue
Block a user