Skip to main content
Task Scheduler | AlgoCracked
AlgoCracked
ProblemsTask Scheduler
Medium57.0% acceptance
Blind75ArrayHash TableGreedySorting

Task Scheduler

You are given an array tasks of single-character strings (each a task type) and an integer n . Each interval either runs one task or is idle. Two runs of the same task type must be separated by at least n intervals of other tasks or idle time. Return the minimum number of intervals needed to finish every task. Input format Input is [tasks, n] , where tasks is an array of single-character strings, e.g. [[ A , A , A , B , B , B ],2] .

Loading workspace…