2423. Remove Letter To Equalize Frequency
Содержание
class Solution:
def equalFrequency(self, word: str) -> bool:
cnt = Counter(word)
for c in cnt.keys():
cnt[c] -= 1
if len(set(v for v in cnt.values() if v)) == 1:
return True
cnt[c] += 1
return False