Guess the 5-digit code
Guess the hidden number in as few attempts as possible.
After each guess, you get feedback as Bulls and Cows:
Bull: a correct digit in the correct position.
Cow: a correct digit in the wrong position.
Hidden number: 4 2 7 1
Your guess: 1 2 3 4
Result: 1 Bull, 2 Cows
The digit 2 is in the correct position (Bull). Digits 4 and 1 are in the number but in different positions (Cows).
Use each result to eliminate impossible digits and positions.
Start with a guess using different digits to gather more information quickly.