Description
Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Examples
Input:
s = "anagram", t = "nagaram"Output:
trueExplanation:
Both strings contain the same characters.
Input:
s = "rat", t = "car"Output:
falseExplanation:
Different characters in the strings.
Input:
s = "listen", t = "silent"Output:
trueExplanation:
Both strings contain the same letters: e, i, l, n, s, t.
Constraints
- •
1 ≤ s.length, t.length ≤ 5 × 10⁴ - •
s and t consist of lowercase English letters.