Given two strings s and t, return true if t is an anagram of s, and false otherwise. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1
Input: s = anagram, t = nagaram
Output: true
Explanation: Both strings use exactly three a's plus one each of n, g, r and m, just in a different order, so t is an anagram of s.
Example 2
Input: s = rat, t = car
Output: false
Explanation: "rat" has a 't' where "car" has a 'c', so the letters do not match.
Example 3
Input: s = a, t = ab
Output: false
Explanation: The strings have different lengths, so they cannot use the same letters.
Two strings are anagrams exactly when they have identical letter counts. Tally the counts of s, then subtract using t; if any count goes negative or lengths differ, they aren't anagrams.
Run checks all cases above. Submit evaluates all test cases.