Valid Anagram
Module 5 · Strings
Problem
Given two strings s and t, return whether t is an anagram of s —
a rearrangement using exactly the same characters with the same
multiplicities.
Examples
Example 1
Input
s = "anagram", t = "nagaram"OutputtrueExample 2
Input
s = "rat", t = "car"OutputfalseConstraints
1 ≤ n ≤ 5·10⁴ · lowercase English letters · follow-up: what if inputs contain arbitrary Unicode?
Attempt it first
The toolkit lesson called count arrays "frequency fingerprints" and said this problem is that observation and nothing more. Prove it to yourself before opening hints — including the early exit that makes many calls O(1).