HTMLify

LeetCode - Check if All Characters Have Equal Number of Occurrences - Python
Views: 16 | Author: abh
class Solution:
    def areOccurrencesEqual(self, s: str) -> bool:
        fa = s.count(s[0])
        for c in set(s):
            if s.count(c) != fa:
                return False
        return True

Comments