class Solution {
    public boolean makeEqual(String[] words) {
        int[] count = new int[26];
        int size = words.length;
        for (String word : words) {
            for (char ch : word.toCharArray()) {
                count[ch - 'a']++;
            }
        }
        for (int i = 0; i < 26; i++) {
            if (count[i] % size > 0) {
                return false;
            }
        }
        return true;
    }
}
//runtime:2 ms
//memory:38.3 MB
