Minimized Maximum of Products Distributed to Any Store

Medium · Binary Search · about 20 minutes

Asked at Google, Amazon, Microsoft.

Distribute products to n stores: quantities[i] units of product type i. Each store gets at most one product type (any amount, possibly zero). Every unit must be distributed. Minimize the maximum number of units given to any store, and return it.

Related guides