Password hacking problem | maths logic game

Password Hacking problem Question: You have a digital lock with a keypad consisting of digits from 0 to 9. The password is a 4-digit number, and each digit is unique. You know that the password contains the digits 1, 2, 3, and 4, but you don’t know the order. You have 10 attempts to guess the password correctly. After each attempt, the lock will display how many digits are correct and in the correct position (denoted as “bulls”) and how many digits are correct but in the wrong position (denoted as “cows”). How can you deduce the correct password within the 10 attempts? Answer: 1. Start by guessing any 4-digit number that contains the digits 1, 2, 3, and 4 in any order (e.g., 1234, 4321, etc.). 2. After each guess, note down the number of bulls and cows. 3. Use the feedback from each guess to refine your next guess. For example: • If you get 4 bulls, you’ve guessed the correct password. • If you get 0 bulls and 0 cows, none of the digits in your guess are corre...