Check if two words are anagrams

Problem Given two words, determine whether one is an anagram of the other (same characters with the same multiplicities, order ignored).

Input / Output

  • Input: strings a and b.
  • Output: boolean.

Constraints

  • Lengths up to 10^5; clarify case sensitivity, Unicode, and whether spaces/punctuation count.

Example

  • "listen" / "silent" → true; "rat" / "car" → false.
asked …
LeaderboardSalaryAccount
Check if two words are anagrams · 2dbi