Just count frequence with Proof||7ms Beats 95.72%
Intuition\n Describe your first thoughts on how to solve this problem. \nEasy problem. Since there are only 26 lowercase characters in the English alphabet, no 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nEasy problem. Since there are only 26 lowercase characters in the English alphabet, no need for a hash table.\n\nNote \n__Theorem.__ When string `s1` is a permutation of string word `s2`, these two strings can Redistribute Characters to Make these 2 Strings Equal\n\nPure C solution is rare which is also implemented.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n[Please turn on English subtitles if necessary]\n[https://youtu.be/vjb-KQnywxY?si=VkqIZt1sTq-r7Kko](https://youtu.be/vjb-KQnywxY?si=VkqIZt1sTq-r7Kko)\nCount the occurrence of each alphabet. \nIf there are `n` strings, it suffices to check\n```\nfreq[i]%n==0 for each i\n```\n_Proof of Theorem_\nstring `s1` is a permutation of string word `s2`\n$\\implies$ $$s1=f_0\\circ\\cdots\\circ f_i\\circ \\cdots \\circ f_k(s2)$$ \nwhere $f_i$ is the swap for 2 characters in different positions for string, say s[a], s[b]. This swap can be done by using several times of moving the desired characters between two strings. __QED__\n\n_Example_ s1="abc" , s2="cba". It only needs a swap(a,c)  to make these 2 strings equal.\n![1897expl.png](https://assets.leetcode.com/users/images/6d39d533-abfe-4711-ad64-b3bd0f8a6db4_1703912006.6638124.png)\n\n\nThe C code solution is slight different & using the suggestion of @Sergei which does not use modular reduction operation.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(nk)$$ where $k$ the average length for strings in `words`\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n\n```C++ []\n#pragma GCC optimize("O3", "unroll-loops")\nclass Solution {\npublic:\n    bool makeEqual(vector<string>& words) {\n        int n=words.size();\n        if (n==1) return 1;\n        int freq[26]={0};\n        for(auto& s: words)\n            for(char c: s)\n                freq[c-\'a\']++;\n        for (int i=0; i<26; i++)\n            if (freq[i]%n!=0) return 0;\n        return 1;\n    }\n};\nauto init = []()\n{ \n    ios::sync_with_stdio(0);\n    cin.tie(0);\n    cout.tie(0);\n    return \'c\';\n}();\n```\n```C []\n#pragma GCC optimize("O3", "unroll-loops")\nbool makeEqual(char** words, int n) {\n    if (n==1) return 1;\n    unsigned freq[26]={0};\n    for (register unsigned i=0; i<n; i++){\n        char* s=words[i];\n        for (register unsigned j=0; s[j]!=\'\\0\'; j++)\n            if (++freq[s[j]-\'a\']==n) freq[s[j]-\'a\']=0;\n    }\n    for (register unsigned i=0; i<26; i++)\n        if (freq[i]!=0) return 0;\n    return 1;\n}\n\n\n```\n# Python code\n\n```\nclass Solution:\n    def makeEqual(self, words: List[str]) -> bool:\n        """\n        Note that when string s1 is a permutation of string word s2, \n        these two strings can Redistribute Characters to Make these 2 Strings Equal\n        """\n        n=len(words)\n        if n==1: return True\n        freq=[0]*26\n        for s in words:\n            for c in s:\n                freq[ord(c)-ord(\'a\')]+=1\n        \n        for f in freq:\n            if f%n!=0: return False\n        return True\n\n        \n```
['String', 'C', 'C++', 'Python3']