Skip to content

Practice Minimized Maximum of Products Distributed to Any Store

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#2064
LeetCode Problem

Minimized Maximum of Products Distributed to Any Store

Problem Statement

quantities[i] is the number of items of product type i. Distribute every item in quantities among n stores. A store may receive items of at most one product type, and some stores may be empty. Return the smallest possible maximum number of items assigned to one store.

Source: Minimized Maximum of Products Distributed to Any Store on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 6, quantities = [11,6]
Output
3

# Example 2

Input
n = 7, quantities = [15,10,10]
Output
5

# Example 3

Input
n = 1, quantities = [100000]
Output
100000

Constraints

m == quantities.length
1 <= m <= n <= 10^5
1 <= quantities[i] <= 10^5

Related LeetCode Problems

Practice more problems similar to Minimized Maximum of Products Distributed to Any Store.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.