469. Unique Frequency String
0
Medium
A string s is considered good if there are no two different characters in s that have the same frequency.
Given a string s, determine the minimum number of characters that must be deleted to make s a good string.
The frequency of a character in a string is the number of times it appears in the string. For example, in the string "aab", the frequency of 'a' is 2, while the frequency of 'b' is 1.
Input Format
Input consists of a single line containing a string.
Output Format
Output should be an integer representing the minimum number of deletions required.
Example
Input
abbccdeeee
Output
3
Constraints
1<= s.length<= 105
Loading...
View Submissions
Console