Valid Anagram

Easy · Arrays & Hashing · Hash Table · String · Counting

Problem

Given two strings s and t, return True if t is an anagram of s.

An anagram uses exactly the same letters with exactly the same multiplicities, in any order.

Examples

Input: s = "anagram", t = "nagaram"
Output: True
Input: s = "rat", t = "car"
Output: False

Constraints

Approaches

Follow-up

How would you adapt your solution if the strings could contain arbitrary Unicode characters?

Related problems

Start free on Cariara · Coding problems · System design studio

Starting Python
No results yet.

          
↑↓ move ↵ open esc close

Labs

Loading labs…

Run with your own input

Starting Python

Loading Python…