classSolution{public:boolisAnagram(string s, string t){int record[26]={0};for(int i =0; i < s.size(); i++){
record[s[i]-'a']++;}for(int i =0; i < t.size(); i++){
record[t[i]-'a']--;}for(int i =0; i <26; i++){if(record[i]!=0){returnfalse;}}returntrue;}};
classSolution{public:
vector<string>commonChars(vector<string>& words){int hash[26]={0};for(int i =0; i < words[0].size(); i++){
hash[words[0][i]-'a']++;}int hashOtherStr[26]={0};for(int i =1; i < words.size(); i++){memset(hashOtherStr,0,26*sizeof(int));for(int j =0; j <words[i].size(); j++){
hashOtherStr[words[i][j]-'a']++;}for(int k =0; k <26; k++){
hash[k]=min(hash[k], hashOtherStr[k]);}}
vector<string> result;for(int i =0; i <26; i++){while(hash[i]!=0){
string s(1, i +'a');
result.push_back(s);
hash[i]--;}}return result;}};