A game master picks a secret word from words, a list of different words that all have the same length (six letters in the tests). You can't see the secret, but you can ask about any word in the list:
master.guess(word: str) -> int
The reply is the number of positions where word has the same letter in the same place as the secret. It says nothing about right letters in the wrong place. A full score (6 for six-letter words) means word is the secret. Guessing a word that isn't in the list raises ValueError.
Write find_secret(words, master) so that one of your guesses is the secret, using at most 12 calls to master.guess. It returns nothing: the master knows when you've hit the secret.
words = ["planet", "plates", "slater", "candle",
"castle", "cradle", "plains", "stolen"]
# the secret is "castle"
master.guess("planet") # 0 no position matches
master.guess("candle") # 4 c, a, l, e are in place
master.guess("castle") # 6 found it
The lists have up to 100 words, so trying them one by one is far too many guesses. The tests take whole lists and run find_secret once for every word as the secret, checking that the secret was guessed and counting your calls. Which word you guess next matters: a careless choice needs 13 or more guesses for some secrets.
Show hint
each reply rules words out. If guess("planet") says 0, the secret can't be any word that shares a position with "planet". More generally, what must be true of the secret's score against a word you've already guessed?