Given a string s, return true if s is a good string, or false otherwise.

A string s is good if all the characters that appear in s have the same number of occurrences (i.e., the same frequency).

&nbsp;
Example 1:

Input: s = "abacbc"
Output: true
Explanation: The characters that appear in s are 'a', 'b', and 'c'. All characters occur 2 times in s.


Example 2:

Input: s = "aaabb"
Output: false
Explanation: The characters that appear in s are 'a' and 'b'.
'a' occurs 3 times while 'b' occurs 2 times, which is not the same number of times.


&nbsp;
Constraints:


	1 &lt;= s.length &lt;= 1000
	s consists of lowercase English letters.


class Solution:
    def areOccurrencesEqual(self, s: str) -> bool:
        return len(set(Counter(s).values())) == 1
class Solution {
    public boolean areOccurrencesEqual(String s) {
        int[] freq = new int[26];
        
        for (int i = 0; i < s.length(); i++) freq[s.charAt(i)-'a']++;

        int val = freq[s.charAt(0) - 'a'];
        for (int i = 0; i < 26; i++)
            if (freq[i] != 0 && freq[i] != val) return false; 

        return true;
    }
}
class Solution {
public:
    bool areOccurrencesEqual(string s) {
        unordered_map<char, int> freq;
        for (auto c : s) freq[c]++;
        int val = freq[s[0]];
        for (auto [a, b] : freq) if (b != val) return false;
        return true;
    }
};
var areOccurrencesEqual = function(s) {
    var freq = {}
    for (let c of s) freq[c] = (freq[c] || 0) + 1
    var val = freq[s[0]]
    for (let c in freq) if (freq[c] && freq[c] != val) return false;
    return true;
};
Check if All Characters Have Equal Number of Occurrences