Task Scheduler — Programming Interview Question Explained

Lintcode #945 and Leetcode #621

Question Setup

Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be idle.