Question 4
John wrote a 3-digit number on a piece of paper and asked Peter to guess it. Peter asked: “Is the number 189?” John replied: “One of the digits is correct. The position of that digit is correct.” Peter asked again: “Is the number 172?” John replied: “One of the digits is correct. The position of that digit is wrong.” Peter asked again: “Is the number 975?” John said: “One of the digits is correct. The position of that digit is also correct.” Given all the digits in that 3-digit number are different, find the number written by John?

