1941. Check if All Characters Have Equal Number of Occurrences

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1941

class Solution:
    def areOccurrencesEqual(self, s: str) -> bool:
        cnt = Counter(s)
        return len(set(cnt.values())) == 1