Group the words that are anagrams of each other.
Input: one line of space-separated words. Output: one group per line, the words within a group in sorted order (groups themselves may be produced in any order — the template prints them canonically).
eat tea tan ate nat bat
ate eat tea bat nat tan
Anagram groups: {eat,tea,ate}, {tan,nat}, {bat}.
a
a
Run your code against the sample tests, or Submit to run the full suite.