Search
⌘K
Get Premium
Leetcode 2218. Maximum Value of K Coins From Piles
Pick exactly k coins from n piles where you may only take coins from the top of a pile (i.e., take a prefix of any pile) to maximize the total value. The core challenge is combining prefix choices across piles — a knapsack-like DP using prefix sums over piles (k up to ~2000, n up to 1000).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.