It seems like this is a brand-new question recently asked by Amazon—I couldn’t find it in our question bank. The examples and test cases are just placeholders for now, but the problem statement should be able to give us a general idea of what they're asking. I’ll share more details once I find reliable sources.
Good news updated on 06-25-2025 - Finally found the missing parts! No more placeholder. We now can start practicing!
You and a colleague are responsible for dispatching goods from multiple warehouses.
The inventory[i] array represents the amount of stock in each warehouse.
Rules:
dispatch1 units of goods from it.- Dispatch
dispatch2units of goods, or - Skip his turn. He can skip up to
skipstimes in total (across all warehouses).
Goal:
Determine the best skipping strategy for your colleague (i.e., in which warehouses he should skip) to maximize the total number of points you and your colleague can earn. Return the maximum number of points that can be obtained.
Complete the function maxPoints in the editor.
maxPoints has the following parameters:
- 1.
int[] inventory: an array representing the stock in each warehouse - 2.
int dispatch1: the number of units you dispatch in your turn - 3.
int dispatch2: the number of units your colleague dispatches in his turn - 4.
int skips: the total number of skips your colleague is allowed
Returns
int: the maximum number of points that can be obtained
inventory = [10, 6, 12, 8, 15, 1] dispatch1 = 2 dispatch2 = 3 skips = 3 return = 5
1 <= n <= 10^51 <= inventory[i] <= 10^91 <= dispatch1, dispatch2, skips <= 10^9Complete constraints set was added on 06-25-2025- Count Promotional PeriodsOA · Seen Jun 2026
- Find Maximum Total Amount (SDE I, Fungible :)Seen Jun 2026
- Get Minimum AmountOA · Seen Jun 2026
- Find Minimum CostOA · Seen Jun 2026
- Get Smallest Base SegmentOA · Seen Jun 2026
- Select Least Resource TasksOA · Seen Jun 2026
- Product Category Group SizesPHONE SCREEN · Seen May 2026
- Count Connected ComponentsPHONE SCREEN · Seen May 2026
public int maxPoints(int[] inventory, int dispatch1, int dispatch2, int skips) {
// write your code here
}