242. Valid Anagram - cocoder39/coco39_LC GitHub Wiki

242. Valid Anagram

bool isAnagram(string s, string t) {
        int sz = 256;
        vector<int> counts(sz,0);
        for (auto c : s) {
            counts[c]++;
        }
        for (auto c : t) {
            counts[c]--;
        }
        
        for(auto count : counts){
            if(count) {
                return false;
            }
        }
        return true;
    }
⚠️ **GitHub.com Fallback** ⚠️