Easy · Strings

Is anagram

Given two strings s and t of lowercase English letters, return true if t is an anagram of s (it uses exactly the same letters, each the same number of times) and false otherwise.

Examples

Example 1

{
  "s": "anagram",
  "t": "nagaram"
}

Output: true (anagram)

Example 2

{
  "s": "rat",
  "t": "car"
}

Output: false (not anagram)

Rebuild it in the studio

Read every interview problem free. Ten rooms need no account. A token opens a problem in full — Pro never counts.

More Strings problems