285. Anagram Check with a Hash Map
Print Yes if the two strings use exactly the same letters the same number
of times, and No otherwise.
listen silent -> Yes
aab abb -> No
Different lengths can never be anagrams, and checking that first saves the rest of the work.
Counting the letters of each and comparing is O(n). Sorting both and
comparing also works and is O(n log n), which is fine here and worth knowing
as the simpler thing to write.
Constraints - `1 ≤ length of each string ≤ 200000` - Both strings are lowercase letters.
Input
The first line contains the string a.
The second line contains the string b.
Both consist of lowercase letters.
Output
Print Yes or No on one line.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.