Trains the technique from
LeetCode 2064Minimized Maximum of Products Distributed to Any StoreThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A sorting hub has couriers vans on the yard tonight and a depot list loads, where loads[i] is the number of parcels waiting at depot i.
Every parcel has to be moved. A van is sent to at most one depot, so everything it carries comes from that single depot, and a van may also be left on the yard carrying nothing. The parcels of a depot may be split between the vans sent to it in any whole numbers you like.
Plan the run so that the heaviest van load is as small as it can be, and return that load.
Example 1
Send four vans to the first depot carrying 3, 3, 3 and 2 parcels, and two vans to the second carrying 3 each. That is six vans, every parcel is moved, and no van carries more than 3.
Example 2
The two single-parcel depots each need a van of their own, which leaves one van for the depot holding 10, and that van has to take all 10.
Example 3
Three vans take 2 parcels each from the first depot and the fourth van takes both parcels of the second depot, so the heaviest van carries 2.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def min_largest_van_load(couriers: int, loads: list[int]) -> int:public int minLargestVanLoad(int couriers, int[] loads)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.