Tap here to switch tabs
Problem
Submissions

Problem: Minimum Deletions for At Most K Distinct Characters

med
30 min
Try to solve the Minimum Deletions for At Most K Distinct Characters problem.

Statement

Given a string s and an integer k, determine the minimum number of character deletions required so that the resulting string contains at most k distinct characters.

Constraints:

  • 1≤1 \leq s.length ≤16\leq 16

  • 1≤1 \leq k ≤16\leq 16

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Deletions for At Most K Distinct Characters

med
30 min
Try to solve the Minimum Deletions for At Most K Distinct Characters problem.

Statement

Given a string s and an integer k, determine the minimum number of character deletions required so that the resulting string contains at most k distinct characters.

Constraints:

  • 1≤1 \leq s.length ≤16\leq 16

  • 1≤1 \leq k ≤16\leq 16

  • s consists only of lowercase English letters.