Mental Model
Group words that have the same letters by sorting them and using the sorted word as a key.
Analogy: Imagine sorting letters of each word like arranging colored beads in order. Words with the same beads in the same order belong to the same group.
words: ["eat", "tea", "tan", "ate", "nat", "bat"]
hash map:
{
"aet" -> ["eat", "tea", "ate"],
"ant" -> ["tan", "nat"],
"abt" -> ["bat"]
}