The code is:
042
Explanations:
One number is correct and is also correctly placed:
2
One number is correct but wrongly placed:
4
Two numbers are correct and wrongly placed:
0 & 2 incorrectly placed
Nothing is correct:
None of them are in the code
One number is correct but wrongly placed:
0
Approach/Thought Process Chosen
682 - One number is correct and well placed
Correct Number's array - 6,8,2
Confirm Number's array -
614 - One number is correct but wrong placed
Correct Number's array - 8,2,1,4(6 is removed since this clue contradicts the previous one and hence 6 should not be present even in the code-The position of 6 is same in Clue 1 and 2 which mean's it can be pushed out of scope)
Confirm Number's array -
206 - Two Numbers are correct but wrong placed
Correct Number's array - 8,2,1,4,0
Confirm Number's array - 0_2(Since 6 is out of scope, consider 2 and 0 to be in the confirm array list and clue 1 says 2 is well placed )
738 - Nothing is correct
Correct Number's array - 0,2,1,4(8 is removed from the array)
Confirm Number's array - 0_2
780 - One Number is correct but wrong placed
Answer from Techidiot on Stack ExchangeCorrect Number's array - 0,2,4(Clues 3 and 5 confirms the position of 0 to be the first. Clues 1 confirms the position of 2. Clue 2 confirms the position of 4 and hence 1 is removed from the list)
Confirm Number's array - 042
logical deduction - Crack the lock code - Puzzling Stack Exchange
Crack the code to open the padlock!
I accidentally locked this lock with no remembering the code, and I need it
Forgot the code to my suitcase, Please give ideas on how to open it
The code is:
042
Explanations:
One number is correct and is also correctly placed:
2
One number is correct but wrongly placed:
4
Two numbers are correct and wrongly placed:
0 & 2 incorrectly placed
Nothing is correct:
None of them are in the code
One number is correct but wrongly placed:
0
Approach/Thought Process Chosen
682 - One number is correct and well placed
Correct Number's array - 6,8,2
Confirm Number's array -
614 - One number is correct but wrong placed
Correct Number's array - 8,2,1,4(6 is removed since this clue contradicts the previous one and hence 6 should not be present even in the code-The position of 6 is same in Clue 1 and 2 which mean's it can be pushed out of scope)
Confirm Number's array -
206 - Two Numbers are correct but wrong placed
Correct Number's array - 8,2,1,4,0
Confirm Number's array - 0_2(Since 6 is out of scope, consider 2 and 0 to be in the confirm array list and clue 1 says 2 is well placed )
738 - Nothing is correct
Correct Number's array - 0,2,1,4(8 is removed from the array)
Confirm Number's array - 0_2
780 - One Number is correct but wrong placed
Correct Number's array - 0,2,4(Clues 3 and 5 confirms the position of 0 to be the first. Clues 1 confirms the position of 2. Clue 2 confirms the position of 4 and hence 1 is removed from the list)
Confirm Number's array - 042
You can see from clue 4 that there are no 7, 3, or 8.
You can see from clue 5 that there is a 0 in either the first or second slot, and from clue 3 that it must be in the first slot. That means the code is [0][?][?].
6 cannot be the correct number from clue 1, since it would have to be in the wrong position for clue 2. We already know 8 is incorrect, so 2 must have to be correct, and it must be in the third slot.
This means the code is [0][?][2].
Finally, from the second clue, we can see that one number is correct but in the wrong place. It can't be 6, since we ruled that out already. It can't be 1, since that would be in the correct place. Therefore the code is 042.