Given a list of CPU `tasks` (single-character labels) and an integer `n`, each task takes one unit of time and the same task must be separated by at least `n` units of cooldown. The CPU may idle. Return the minimum total units of time to finish all tasks.