Are the Two Strings Anagrams? (Set 3)

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 3) — the data. This set runs 4 cases: first is a string of 5–8 characters; second is a string of 5–9 characters. The hidden cases are the largest of the set.

Example 1

isAnagramPair()
Input
first = "gpasu", second = "gpasuq"
Output
false

Why

`isAnagramPair` returns `false` for this input.

Example 2

isAnagramPair()
Input
first = "aprzz", second = "azzpr"
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.