← All problems

Task Scheduler

Medium heapsgreedymath LeetCode ↗
Minimum intervals to run tasks with cooldown n between same tasks.

Hints (0/3 revealed)

Log in to reveal hints progressively.

Complexity

Time O(n), Space O(1) formula

Common pitfalls

  • Forgetting the +count of max-frequency ties
  • Missing the max(total) case

Your solution

Log in to save your code and track progress.