leetle

Daily challenge for 2025-09-18

261. Task Scheduler

Given a characters array tasks representing tasks to do and integer n representing the cooling period, return the least number of units of time needed to execute all tasks.

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

Execution order: A -> B -> idle -> A -> B -> idle -> A -> B (8 units)

Run this challenge interactively in Python or JavaScript when the app loads.