2423. Remove Letter To Equalize Frequency
You are given a 0-indexed string
word
, consisting of lowercase English letters. You need to select one index and remove the letter at that index fromword
so that the frequency of every letter present inword
is equal.Return
true
if it is possible to remove one letter so that the frequency of all letters inword
are equal, andfalse
otherwise.Note:
- The frequency of a letter
x
is the number of times it occurs in the string.- You must remove exactly one letter and cannot choose to do nothing.
1 | class Solution { |