Back to problems

Find a secret word via match feedback

Algorithm · Moveworks · Hard

You are given a list wordlist of distinct strings. Every entry has the same length L and uses only lowercase English letters. One entry in this list is the hidden secret. You can query the hidden word with match(guess): it returns the number of positions i where guess[i] == secret[i]. Your task is to discover and return the secret by making queries through match, using no more than a small guess budget. A guess must be an entry from wordlist. Implement findSecret(wordlist,…

Checking your access…