Problem 1737 · Medium

Change Minimum Characters to Satisfy One of Three Conditions

Try every boundary letter and count the characters on the wrong side, using letter frequency prefix sums.

Open the interactive visualisation