1# Runtime: 2321 ms (Top 5.03%) | Memory: 29.8 MB (Top 75.04%)2import math345class Solution:6def taskSchedulerII(self, tasks: List[int], space: int) -> int:7count_dict = {}8total_days = 09for task in tasks:10if task not in count_dict:11count_dict[task] = -math.inf12total_days = max(total_days + 1, count_dict[task] + space + 1)13count_dict[task] = total_days14return total_days