Problem 1653 · Medium

Minimum Deletions to Make String Balanced

Delete the fewest characters so every a comes before every b. The visual scans left to right, tracking the cost of splitting at each point.

Open the interactive visualisation