EEasy· hash-map· string· sorting
Valid Anagram
Valid Anagram
Given two strings s and t, return true if t is an anagram of s, and false otherwise. An anagram is a word formed by rearranging the letters of another word using all the original letters exactly once.
Example
Input: s = "anagram", t = "nagaram" → Output: true
Input: s = "rat", t = "car" → Output: false
Constraints
- 1 ≤ s.length, t.length ≤ 5 × 10⁴
sandtconsist of lowercase English letters.
Entry — isAnagram
Grading — exact over 5 tests