HTMLify
LeetCode - Check if All Characters Have Equal Number of Occurrences - Python
Views: 400 | Author: abh
1 2 3 4 5 6 7 | 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 |