Escape RoomRiddle #1412
Five failed attempts are written beside a four-digit lock. 6748: one digit right and placed, one right but misplaced. 2198: one right and placed, one right but misplaced. 7812: three digits right, all misplaced. 3907: one right, misplaced. 4671: one right, misplaced. What's the code?
Hint: 7812 gives you three of the four digits. Find out which one doesn't belong.
Answer
2785
If 1 were in the code, 4671 would rule out 7, so 7812 would need 8, 1 and 2, giving 2198 three correct digits instead of two. So 1 is out and 7, 8, 2 are in. Then 4671 and 3907 rule out 4, 6, 3, 9 and 0. 7 can't be 1st (7812), 3rd (4671) or 4th (3907), so it's 2nd. That makes 7 the placed digit in 6748, so 8 isn't 4th, and in 2198 the 2 must be placed: 2 is 1st. 8 takes the 3rd spot. The last digit can't be any digit already ruled out or a repeat that would turn a clue's misplaced digit into a placed one, which leaves only 5, never mentioned: 2785. Brute force over all 10,000 codes confirms it.
Did you get it?
Nice work. On to the next one.
Got you this time. Try the next one.
