classSolution{public:boolisAnagram(string s, string t){int hash[26];if(s.size()!= t.size())returnfalse;for(int i =0; i < s.size(); i++){
hash[s[i]-'a']++;
hash[t[i]-'a']--;}bool flag =true;for(int i =0; i <26; i++){if(hash[i]!=0) flag =false;}return flag;}};
classSolution{public:intSum(int n){int ans =0;while(n){
ans +=(n %10)*(n %10);
n = n/10;}return ans;}boolisHappy(int n){
unordered_set<int> se;while(1){int sum =Sum(n);if(sum ==1)returntrue;if(se.find(sum)!= se.end())returnfalse;else se.insert(sum);
n = sum;}}};