String Manipulation

Anagram Check

easystringstringhash-mapsort
0:00

Problem

Given two strings `s` and `t`, return `true` if `t` is an anagram of `s` (same characters, same counts), otherwise `false`. Consider them case-sensitive.

Your solution
Test results
Click Run tests to check your solution against the test cases.

About this challenge

Anagram Check is a easy string manipulation coding challenge. It tests string-manipulation techniques: parsing, transforming, and searching text efficiently. Write your solution in the editor above, run it against the test cases, and get instant feedback — free, in your browser, no sign-up.

Show a hint & approach (spoiler)

Hint: Sort both strings and compare, or count character frequencies in a map.

Keep practicing

Browse all coding challenges, or build intuition for the underlying concepts with the algorithm visualizers and the developer cheatsheets.