Task-scheduler closed-form min total intervals:
m = max letter frequency
k = number of letters tied at frequency m
answer = max((m - 1) * (n + 1) + k, total_tasks)
For "AAABBC" with cooldown n = 2:
freq A = 3, freq B = 2, freq C = 1 -> m = 3, k = 1
formula = (3 - 1) * (2 + 1) + 1 = 7
total tasks = 6
answer = 7
Witness schedule: A, B, C, A, B, idle, A.
Tests String.iter with side-effecting count update via
Char.code arithmetic, fixed-size 26-bucket histogram.
195 baseline programs total.