A Wordle solver needs to answer one question: given everything I know so far, which 5-letter words are still possible?
In a running game, you accumulate clues across multiple guesses:
Green 🟩 — correct letter, correct position
Yellow 🟨 — correct letter, wrong position
Gray ⬜ — letter not in the word
After 2-3 guesses, you might have constraints like:
Position 1 = S (green), R is somewhere but not position 2, A and E are excluded entirely.
That's a lot of state to track. And it has to update instantly as you type.
The Approach
Dictionary Preprocessing
Everything starts with the dictionary. SOWPODS (Scrabble International word list) contains ~267K words. I filtered it down to 12,470 five-letter words — the Wordle candidate pool.
This was a one-time preprocessing step.…