Problem 3398 · Hard

Smallest Substring With Identical Characters I

Binary search the longest run allowed and flip characters greedily whenever a run would grow past it.

Open the interactive visualisation