Minimum Deletions to Make Character Frequencies Unique

Given a string, you need to determine the minimum number of deletions required to make the string 'good', meaning that no two different characters have the same frequency.

Constraints

  • 1 <= s.length <= 10^5
  • s contains only lowercase English letters.
Saving… · 3 lines
class Solution:
def minDeletionsToMakeFrequenciesUnique(self, s: str) -> int:

Console

Click Run to execute sample tests.