Search⌘ K
AI Features

Solution: Guess the Word

C# solution for the Guess the Word problem using the Knowing What to Track pattern.

We'll cover the following...

Statement

You are given a list of candidate words words, where each word has length 66 and all words are distinct. One of these words is the hidden word secret.

You can interact with an external API master.guess(word), which takes a string word and returns an integer equal to the number of positions where word and secret have the same character. If word is not present in words, the API returns 1-1.

Implement findSecretWord(words, master) to identify secret by calling master.guess at most allowedGuesses times.

Note: Each call to master.guess must use a word from words, and secret is guaranteed to be in words.

Constraints:

  • 11 \leq words.length 100\leq 100 ...