arrow_back Back to Challenges

#49 Group Anagrams

Medium Acceptance 0%
description

Problem Description

Given an array of strings `strs`, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

checklist Constraints

1 <= strs.length <= 10^4
0 <= strs[i].length <= 100
strs[i] consists of lowercase English letters.

science Examples

Case #1

In: strs = ["eat","tea","tan","ate","nat","bat"]
Out: [["bat"],["nat","tan"],["ate","eat","tea"]]

Case #2

In: strs = [""]
Out: [[""]]

Mastery Tags

Arrays Hash Table Sorting Strings

Hiring Companies

Amazon Google Meta
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude