Given a string word consisting of lowercase English letters, determine whether it is possible to remove exactly word such that the frequency of every remaining distinct character in the string is equal.
Return true if this is possible, and false otherwise.
Note: The frequency of a character is the count of its occurrences in the string. After removing
character, characters with a frequency of are ignored when checking if all remaining characters have equal frequencies.
Constraints:
word.length
word consists of lowercase English letters only.
Given a string word consisting of lowercase English letters, determine whether it is possible to remove exactly word such that the frequency of every remaining distinct character in the string is equal.
Return true if this is possible, and false otherwise.
Note: The frequency of a character is the count of its occurrences in the string. After removing
character, characters with a frequency of are ignored when checking if all remaining characters have equal frequencies.
Constraints:
word.length
word consists of lowercase English letters only.