class Solution {
public:
bool isAnagram(string s, string t) {
int hash[26] = {0};
for(int i = 0; i < s.size(); i++) {
hash[s[i] - 'a']++;
}
for(int i = 0; i < t.size(); i++) {
hash[t[i] - 'a']--;
}
int idx = 0;
while(idx < 26) {
if(hash[idx++]) return false;
}
return true;
}
};