Hacker News new | ask | show | jobs
by ttub 3508 days ago
This problem also has an "infamous" and very simpe, elegant solution described in Programming Pearls:

"The idea is to give words that are anagrams a common signature, sort all the words together by their signatures, and then print them."

https://www.gnu.org/software/gawk/manual/html_node/Anagram-P...