242. 有效的字母异位词

class Solution {
public:
    bool isAnagram(string s, string t) {
        int a[26];

        for (auto ss : s) {
            a[ss - 'a']++;
        }

        for (auto tt : t) {
            a[tt - 'a']--;
        }

        for (int i = 0; i < 26; i++) {
            if (a[i] != 0) {
                return false;
            }
        }
        return true;
    }
};