1921. Eliminate Maximum Number of Monsters

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

Содержание

LeetCode problem 1921

class Solution:
    def eliminateMaximum(self, dist: List[int], speed: List[int]) -> int:
        times = sorted((d - 1) // s for d, s in zip(dist, speed))
        for i, t in enumerate(times):
            if t < i:
                return i
        return len(times)