cheetcode

2. Valid AnagramEasy

Check whether two strings contain the same characters with the same counts.

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

An anagram uses exactly the same letters the same number of times, only in a different order.

Examples

Input: s = "anagram", t = "nagaram"
Output: true
Input: s = "rat", t = "car"
Output: false
Input: s = "aacc", t = "ccac"
Output: false

Constraints

  • 1 <= s.length, t.length <= 50,000
  • s and t consist of lowercase English letters.