← Questions

Guess the word

0
Character.AICodingLast asked Jul 2024

A secret word is one of a list of distinct words of equal length. Each guess must be a word from the list, and the answer tells you how many positions match the secret exactly (same letter at the same index). Find the secret in as few guesses as possible.

Start by filtering the candidates that agree with every answer so far. Then choose each next guess well: for example, pick the candidate whose worst-case group of remaining words (grouped by the score it would get) is smallest, and discuss entropy-style alternatives.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding