Problem statement
Given a list of words, group the ones that are rearrangements of each other. Every word in a group must be a rearrangement of every other word in it, and no two groups may mix.
A group may hold a single word, because a word that nothing else matches is still a group of its own.
Examples
Input["eat", "tea", "tan", "ate", "nat", "bat"]
Output{eat, tea, ate}, {tan, nat}, {bat}
Three words sort to aet, two sort to ant, and bat has a key of its own.
Input["abc"]
Output{abc}
One word is one group. The walk never needs a second word to place the first.
The walkthrough is part of Premium
The statement and the examples above stay free. The full how-to-solve walkthrough, the cost notes in plain words and the interactive step-by-step visualizer unlock with a Premium plan.
See pricing