1
# Runtime: 2321 ms (Top 5.03%) | Memory: 29.8 MB (Top 75.04%)
2
import math
3

4

5
class Solution:
6
def taskSchedulerII(self, tasks: List[int], space: int) -> int:
7
count_dict = {}
8
total_days = 0
9
for task in tasks:
10
if task not in count_dict:
11
count_dict[task] = -math.inf
12
total_days = max(total_days + 1, count_dict[task] + space + 1)
13
count_dict[task] = total_days
14
return total_days

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0