Two strings are anagrams if one is a rearrangement of the other. They have the same characters, and each character is used the same number of times. For example, "race" and "care".
Write isAnagram(a, b) that returns true if a and b are anagrams and false otherwise.
- Characters are compared exactly:
"A"and"a"are different, and spaces count. - Two empty strings are anagrams of each other.
- Strings can be up to 100,000 characters long.
Input: a = "race", b = "care"
Output: true
Input: a = "aab", b = "abb"
Output: falseSame letters, different counts.
Input: a = "Tea", b = "eat"
Output: false"T" and "t" are different characters.