Problem 3545 · Easy

Minimum Deletions for At Most K Distinct Characters

Keep the k most frequent letters and delete every other character.

Open the interactive visualisation