Hacker News new | ask | show | jobs
by mbb70 144 days ago
Start with your chosen dictionary, remove small words and all 's'es.

Then find all words with 7 unique letters, then get the unique set of letter sets. These are your valid puzzles times 7 for each selection of a center letter.

Construct a trie of your dictionary. For each letter of each puzzle, walk the trie using only the puzzle letters. When you find a word, if it used the center letter, add to list.

In practice it's log(n) for size of dictionary.