EasyTopic: Strings & HashingExpected: O(N) Time • O(1) Space

Valid Anagram Check

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 a different word, using all the original letters exactly once.

Examples
Input: s = "anagram", t = "nagaram"
Output: true
Input: s = "rat", t = "car"
Output: false
Constraints
  • 1 <= s.length, t.length <= 5 * 10^4
  • s and t consist of lowercase English letters.
solution.js
JavaScript (ES6+)
Test Execution Results
Input:["anagram","nagaram"]
Expected:true
Your Output:--