Skip to main content
🧩 Algorithms & Problem Solving

Anagram Check

Two strings are anagrams if they contain the same letters in any order ("listen" / "silent"). Normalize (lowercase, strip non-letters), sort the characters, and compare.

Your task

Write isAnagram(a, b) returning true if the two strings are anagrams, ignoring case and spaces.

⚑ 40 XP
solution.jsRuns in your browser
Loading editor…
Tests3 to pass
listen / silent
hello / world
ignores case & spaces

Run your code to check these.