2064. Minimized Maximum of Products Distributed to Any Store

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2064

class Solution:
    def minimizedMaximum(self, n: int, quantities: List[int]) -> int:
        def check(x):
            return sum((v + x - 1) // x for v in quantities) <= n

        return 1 + bisect_left(range(1, 10**6), True, key=check)