Minimum Days to Deliver Parcels
Amazon Delivery Centers dispatch parcels every day. There are n delivery centers, each having parcels[i] parcels to be delivered.
On each day, an equal number of parcels are to be dispatched from each delivery center that has at least one parcel remaining.
Find the minimum number of days needed to deliver all the parcels.
Complete the function minDaysToDeliverParcels in the editor below.
minDaysToDeliverParcels has the following parameters: int parcels[n]: the number of parcels at each center
Returns
int: the minimum number of days needed to deliver all the parcels
Constraints
1 ≤ n ≤ 10^60 ≤ parcels[i] ≤ 10^9
1Example 1
2Example 2
Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 10^60 ≤ parcels[i] ≤ 10^9