Example 1
Input
s = "listen", t = "silent"
Output
true
Loading CodeSprint...
/problems/valid-anagram
Two strings are anagrams when they use the same letters with the same frequencies, possibly in a different order. Decide whether the provided strings are anagrams.
Implement this function and return the result. CodeSprint supplies each test case automatically.
isAnagram(s, t) → booleanInput
s = "listen", t = "silent"
Output
true
Input
s = "rat", t = "car"
Output
false
Constraints
0 <= s.length, t.length <= 100,000 Both strings contain lowercase English letters.