Given two strings s and t, return true if t is an anagram of s, and false otherwise. An anagram uses the same characters with the same frequencies.
s = "anagram", t = "nagaram"trues = "rat", t = "car"false|s| ≠ |t| → immediately return falsefreq[26] (or map), all zerosi: freq[s[i]]++ and freq[t[i]]--freq[c] ≠ 0 → return falseIncrementing for s and decrementing for t in the same pass is like subtracting their character counts. If they are anagrams, every count cancels to zero. Any leftover non-zero entry means one string has a character the other lacks.