Given two strings s and t, return true if and only if t is an anagram of s — that is, both strings contain exactly the same characters with the same frequencies.
Use a character-count hash map: walk s incrementing counts, then walk t decrementing. The strings are anagrams iff every count ends at zero (and the lengths match).
Example: s = "anagram", t = "nagaram" → true. s = "rat", t = "car" → false.
"anagram"
true