#6 most askedVery commonMediumHash map
Group Anagrams
New to Hash map? Learn it from scratch firstHash Maps & Sets โ
๐ข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.Group words that are anagrams of each other (same letters, different order). Return the groups in any order.
["eat", "tea", "tan", "ate", "nat", "bat"] โ [["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]
๐งช Practice
Write your solution, then press Run tests. Explain your approach out loud as you go.
def group_anagrams(words):
pass
Output appears here. Press Run or Ctrl/โ + Enter.
Try it first. Struggling for a few minutes is how it sticks.