Mental Model
Group words that have the same letters by sorting their letters and using that as a key.
Analogy: Imagine sorting letters of each word like putting puzzle pieces in order; words with the same pieces fit into the same box.
words: [eat, tea, tan, ate, nat, bat]
keys: [aet, aet, ant, aet, ant, abt]
Hash Map:
{
'aet' -> [eat, tea, ate]
'ant' -> [tan, nat]
'abt' -> [bat]
}