3545. Minimum Deletions for At Most K Distinct Characters
You are given a string
sconsisting of lowercase English letters, and an integerk.Your task is to delete some (possibly none) of the characters in the string so that the number of distinct characters in the resulting string is at most
k.Return the minimum number of deletions required to achieve this.
1 | class Solution { |