online advertising

Sunday, August 5, 2018

Code

Problem:


Solution:

One number in 780 is correct but not correct position, but 738 is not correct, so 0 is correct and wrong position.

For 682, one number is correct but wrong position. We know 8 is impossible, but if the correct one is 6, then for 614, it couldn't be wrong position. Therefore we know 2 is correct and correct position.

By now, we know the answer is xx2, where one of them is 0, since 206 has two correct but wrong position, therefore the answer must be 0x2

Last but not least, we know 614 has one correct but wrong position, therefore the answer must be 042!

As always, the answer is 42!