Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 445 Bytes

File metadata and controls

12 lines (9 loc) · 445 Bytes

Problem 7: Strategic Scheduling

Problem Statement

Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. There is a cooldown period n between two same tasks. Return the least number of units of time to finish all tasks.

Input Format

  • An array of characters tasks.
  • An integer n.

Example

Input: tasks = ["A","A","A","B","B","B"], n = 2
Output: 8