Valid Anagram
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?
Example 1
Input
s = "anagram", t = "nagaram"Output
truet is an anagram of s because both strings contain the same characters with the same frequencies.Example 2
Input
s = "rat", t = "car"Output
falset is not an anagram of s because the strings do not contain the same characters with the same frequencies.Constraints
- 1 <= s.length, t.length <= 5 * 10^4
- s and t consist of lowercase English letters.