Are the Two Strings Anagrams? (Set 6)

Easy

Given two lowercase strings first and second, return true when one is an anagram of the other — the same letters with the same counts, in any order.

Are the Two Strings Anagrams? (Set 6) — the data. This set runs 4 cases: first is a string of 3–8 characters; second is a string of 4–9 characters. The hidden cases are the largest of the set.

Example 1

isAnagramPair()
Input
first = "tad", second = "tadq"
Output
false

Why

`isAnagramPair` returns `false` for this input.

Example 2

isAnagramPair()
Input
first = "qqqcxb", second = "xqcqqb"
Output
true

Why

`isAnagramPair` returns `true` for this input.
Constraints
0 <= first.length, second.length <= 10^4
Lowercase letters only.
Every case in this set must pass: the first two are visible on Run, the last two unlock on Submit.

Topics

StringsHash Table

Implement isAnagramPair in the editor and return the answer — printing it is never graded.