2365. Task Scheduler II

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

Содержание

LeetCode problem 2365

class Solution:
    def taskSchedulerII(self, tasks: List[int], space: int) -> int:
        day = defaultdict(int)
        res = 0
        for task in tasks:
            res += 1
            res = max(res, day[task])
            day[task] = res + space + 1
        return res