leastInterval = function(tasks, n) {
  const frequencyMap = getFrequencyMap(tasks)
  const maxHeap = getMaxHeap(frequencyMap)

  return getMinimumCpuIntervals(maxHeap, n)
}
https://leetcode.com/problems/task-scheduler/
Time O(N * log(N)) | Space O(N)
@param {character[]} tasks
@param {number} n
@return {number}