Question 30
Answer-format rule: round a non-integer result to the nearest integer. If the calculated answer has more than five digits, give its last five digits.
Optional bonus. Tom chooses a four-digit code using distinct digits from 0 to 9. Jerry guesses; Tom reports the number of correct digits and the number of correct digits in their correct positions. For example, for code 2561 and guess 2018, two digits (2 and 1) are correct and only 2 is in the correct position. Jerry makes five guesses. The table lists (guess; correct digits; correct positions): (3456; 1; 1), (7890; 1; 1), (1234; 3; 0), (2148; 2; 1), (3172; 3; 3). Determine Tom’s code.

Optional bonus. Tom chooses a four-digit code using distinct digits from 0 to 9. Jerry guesses; Tom reports the number of correct digits and the number of correct digits in their correct positions. For example, for code 2561 and guess 2018, two digits (2 and 1) are correct and only 2 is in the correct position. Jerry makes five guesses. The table lists (guess; correct digits; correct positions): (3456; 1; 1), (7890; 1; 1), (1234; 3; 0), (2148; 2; 1), (3172; 3; 3). Determine Tom’s code.
