Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e6d344a

Browse files
Update best-time-to-buy-and-sell-stock-iv.go
1 parent 95a2f8d commit e6d344a

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

‎best-time-to-buy-and-sell-stock-iv/best-time-to-buy-and-sell-stock-iv.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
package best_time_to_buy_and_sell_stock_iv
44

5-
import "fmt"
6-
75
func maxProfit(k int, prices []int) int {
86
if k == 0 || len(prices) <= 1 {
97
return 0
@@ -24,12 +22,8 @@ func maxProfit(k int, prices []int) int {
2422
}
2523
dp[i][j][0] = max(dp[i-1][j][0], dp[i-1][j][1]+prices[i])
2624
dp[i][j][1] = max(dp[i-1][j][1], dp[i-1][j-1][0]-prices[i])
27-
28-
fmt.Println(dp[i][j])
2925
}
30-
fmt.Println("--")
3126
}
32-
//fmt.Println(dp)
3327
return dp[len(prices)-1][k][0]
3428
}
3529

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /