/SearchAnagramWords

Search anagram words from the given file. Think about large data sets. Write anagram words in one line and keep the insertion order of the given file, write anagram words in one line and sort them lexicographically.

Primary LanguageJavaApache License 2.0Apache-2.0

SearchAnagramWords

Requirements
You are given with a large data set, every line of the file has one word.
You need to read the file and group anagram words, consist of same characters in different order (i.e. except, expect).
You need to keep the insertion order, however, sort the anagram words lexicographically among each other.
If a word has no anagram word in the file, do not write it to the output file.
Focus on maintainability, scalability, performance.
No need for extensive error handling.

GIVEN INPUT
who
how
except
expect
tree
purse

EXPECTED OUTPUT
how who
except expect