Algorithm · Google · Hard
Requirements The secret is a five-character lowercase word, with each character in a..z. Implement recover_word(query, dictionary). The supplied query callback takes a zero-based position and a character, then reports whether that character appears at that position. Your function must determine and return the secret word. The main objective is to use as few query invocations as possible. Naive upper bound: testing all 26 letters at each of 5 slots takes 5 × 26 = 130 calls.…
Checking your access…