You are give:
Our mission this time is to help the company calculate the minimum possible value of the maximum number of packages assigned to any delivery center after distributing all the extra packages optimally.
Examples
01 · Example 1
packages = [7, 5, 1, 9, 1] extra_packages = 25 return = 10

There are other possible optimal assignments, but the minimum value of the maximum value of the maximum number of pacakges any delivery center will deliver is 10.
(Updated on 2025-01-19)
02 · Example 2
packages = [1, 2, 3] extra_packages = 3 return = 3
Assign two extra pacakges to the 1st delivery center and one extra to the second center.
Eventually, each center will have to send three packages.
(Added on 2025-02-15)
03 · Example 3
packages = [1] extra_packages = 3 return = 4
Because we have only 1 delivery center, all the extra packages will be assigned to the same :)
(Added on 2025-02-15)
Constraints
1 <= n <= 10^51 <= extra_packages <= 10^151 <= packages[i] <= 10^9constraints added on 01-27-2025More Amazon problems
- 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
- Maximum Non-Adjacent House ValueONSITE INTERVIEW · Seen Jun 2026
- Running Delivery Time MediansONSITE INTERVIEW · Seen Jun 2026
- Select Least Resource TasksOA · Seen Jun 2026
public int minimizeMaximumParcels(int[] packages, int extraParcels) {
// write your code here
}
packages[7, 5, 1, 9, 1]
extra_packages25
expected10
sign in to submit