Minimize CPU idle time by scheduling tasks with a cooldown using a max-heap.
Constraints
Example
>>> least_intervals(['A','A','A','B','B','B'], 2) 8 >>> least_intervals(['A','A','A','B','B','C'], 1) 6 >>> least_intervals(['A','A','A'], 2) 7 >>> least_intervals(['A','B','C'], 1) 3
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints