Practice Guess the Word
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
One of the unique six-letter strings in words is secret. Each guess must be a six-letter entry from words. Use Master.guess(word) to identify it: the result is the number of characters matching the secret in both letter and position, or -1 for a word outside words. You must actually call Master.guess with the secret word within allowedGuesses calls. Merely identifying it without that call does not succeed. Inputs are chosen to permit success with a suitable strategy within the limit.
Source: Guess the Word on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
secret = "acckzz", words = ["acckzz","ccbazz","eiowzz","abcczz"], allowedGuesses = 10
You guessed the secret word correctly.
# Example 2
secret = "hamada", words = ["hamada","khaled"], allowedGuesses = 10
You guessed the secret word correctly.
Constraints
Related LeetCode Problems
Practice more problems similar to Guess the Word.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.