by returningfory2 · 4y ago · 0 comments
I'm making this comment because I started with the same O(N^3) approach and then realized this. :)
That's not true. Suppose the actual word is "abcdx" but the guessed word is "xefgh". The result of testing is Yellow-Black-Black-Black-Black.
Now suppose you have other words like "xijkl" that will test against the solution in exactly the same way (Yellow-Black-Black-Black-Black), but you know won't be the correct solution because in the first round the misplaced "x" already tells you "x" should be present at a different position.
So now we have a word that can be eliminated even if it tests against the solution in the way the guessed word does.