Back to problems

Schedule tasks with cooldown

Algorithm · Microsoft · Hard

A processor must work through a collection of jobs. Every job is labeled by one uppercase English letter, and jobs sharing the same letter are considered the same job type. During any single time unit the processor runs at most one job. Between two runs of a job of the same type, the cooldown rule forces a gap: at least n time units must sit between them. Each unit inside that gap is either filled by a job of a different type or left completely empty as an idle unit.…

Checking your access…