Available question text
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).
Related questions
Continue with questions that share topics or the same question type.
- Given an array nums and a sliding window of size k moving from the very left to the very right, return the maximum value in the window for each position. Solve in O(n) time using a deque.
Coding
- Maximum Coins From K Consecutive Bags
Coding · Array · Binary Search · Greedy
- Maximum Points After Collecting Coins From All Nodes
Coding
- Find Maximum Removals From Source String
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2218. Maximum Value of K Coins From Piles
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source