Determine the Best Skipping Strategy
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
1Example 1
Constraints
Limits and guarantees your solution can rely on.
1 <= n <= 10^51 <= inventory[i] <= 10^91 <= dispatch1, dispatch2, skips <= 10^9Complete constraints set was added on 06-25-2025