Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 646 Bytes

27.md

File metadata and controls

28 lines (21 loc) · 646 Bytes
bool makeEqual(vector<string>& words) {

        int n=words.size();
        if(n==1)
            return true;


        unordered_map<char,int> ans;

        for(int i=0;i<words.size();i++)
        {
            string s=words[i];
            for(int j=0;j<s.size();j++)
                ans[s[j]]++;
        }
        
        
        for(auto it: ans)
        {
            if(it.second%n!=0)
                return false;
        }
        return true;
    }