You are given a list of equal-length words and a secret word from that list. You repeatedly guess words; each guess returns the number of positions that exactly match the secret. Using the deterministic strategy of always guessing the first remaining candidate and then keeping only candidates whose match count against that guess equals the secret's match count, return the number of guesses made until the secret is guessed. The input is JSON {words, secret}.
Input: JSON {words, secret}.
Output: Integer — the number of guesses made.
Input: {"words":["abc","abd","xyz","abe"],"secret":"abe"}
Output: 3
Explanation: Filtering by match count narrows to the secret in 3 guesses.Input: {"words":["aa","bb","cc"],"secret":"bb"}
Output: 2
Explanation: Two guesses isolate the secret.Input: {"words":["abc"],"secret":"abc"}
Output: 1
Explanation: One guess.1<=words<=100all words equal lengthsecret is in words