Step-by-step explanation:
Given : options for key lock
2 9 1 - one number is correct and well placed
2 4 5 - one number is correct but wrong placed
4 6 3 - Two numbers are correct but wrong placed
5 7 8 nothing is correct
5 6 9 one number is correct but wrong placed
To find : code to open lock
<h3>Solution:</h3>
2 9 1 - one number is correct and well placed
2 4 5 - one number is correct but wrong placed
Hence 2 can not be correct number
5 7 8 nothing is correct
so 2 , 5 , 7 & 8 are not the number in code
2 4 5 - one number is correct but wrong placed
2 & 5 are not correct
hence 4 is correct but wrong placed
4 6 3 - Two numbers are correct but wrong placed
Hence location of 4 is defined as 1st & 2nd position are bot correct
and out of 6 & 3 one has to be correct
x x 4
2 9 1 - one number is correct and well placed
1 can not be well placed as last position is already taken
hence 9 is correct & well placed
x 9 4
5 6 9 one number is correct but wrong placed
9 is the number
hence 6 can not be correct
so
out of 6 & 3 - 3 has to be correct
3 9 4 is the code
<h3>
Hope this helps.</h3>