2dbi
Home/Twilio/Group Anagrams
TTwilio·DSAP2Technical Phone Screen

Group Anagrams

Problem

Group strings that are anagrams of each other.

Example

["eat","tea","tan","ate"] -> [["eat","tea","ate"],["tan"]]

Constraints

  • 1 ≤ n ≤ 10^4

Approach

Char-count tuple as the hash key. Twilio coding skews LC-medium with emphasis on communication.

added 6 days ago
LeadersAccount