1760. Minimum Limit of Balls in a Bag

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1760

class Solution:
    def minimumSize(self, nums: List[int], maxOperations: int) -> int:
        def check(mx: int) -> bool:
            return sum((x - 1) // mx for x in nums) <= maxOperations

        return bisect_left(range(1, max(nums)), True, key=check) + 1