Group Anagrams

Try to solve the Group Anagrams problem.

Statement

Given a list of words or phrases, group the words that are anagrams of each other. An anagram is a word or phrase formed from another word by rearranging its letters.

Constraints:

Let strs be the list of strings given as input to find the anagrams.

  • 1≤1 \leq strs.length ≤103\leq 10^3
  • 0≤0 \leq strs[i].length ≤100\leq 100
  • strs[i] consists of lowercase English letters.

Note: The order in which the output is displayed doesn’t matter.

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy