#16

Valid Anagram

Easy
All Problems

16. Valid Anagram#242

Easy📊 Arrays & HashingFrequency Count

Determine if two strings are anagrams of each other.

Examples

Example 1:
Input: ["anagram","nagaram"]
Output: true
Example 2:
Input: ["rat","car"]
Output: false
Example 3:
Input: ["a","a"]
Output: true

Why learn this

Classic frequency counting problem. Builds hash map intuition for string problems.

StringsHash MapsSorting
Python 3Loading Python engine...
Click "Run Code" to test your solution