Remove Letter to Equalize Frequency
Problem statement
Return whether deleting exactly one character occurrence from lowercase string word can make every remaining character have the same positive frequency.
Function
equalFrequency(word: String) → booleanExamples
Example 1
word = "abcc"return = trueRemove one c, leaving every character once.
Example 2
word = "aazz"return = falseOne deletion leaves frequencies 1 and 2.
Constraints
2 <= word.length <= 10^5.wordcontains lowercase English letters.