I see no unique solution for this:
Unless you assume the solution must uniquely defined by the information given.
(Or hopefully simpler terms all the numbers appear in the correct position in the responses.)
Naming the friends A,B,C,D gives A: 280, B: 376 , C: 304 , D: 370
Position 1 has possibilities 2,3,3,3
Assuming 3 is right leads to no unique solution...
- B,C,D all have now have exactly one match
- For a match from A either position 3 is 0 or position 2 is 8
- Position 3 cannot be 0 as D has this and has already got 1 position correct
- So position 2 is 8
- The solution is 28x (where x is unknown)
- As no 3rd digit can be right x cannot be 0,4,6
There are many possible solutions: 381, 382, 383, 385, 387, 388, 389
By assuming a solution must contain only position-number pairs present in the given responses we can now say position 1 cannot be 3. This is because the solutions above do not satisfy this as none of the solutions contains a number in the 3rd position which is in the 3rd position of a response...
So in position 1 A must be right with a value of 2,
- Position 2 can be one of 7,0,7 (B, C, D)
- If 0 is right A and C have exactly 1 right
- There are now no matches in either B or D thus there is no solution as one of B and D will have no match.
- Therefore in the 2nd position 7 is right and A,B and D have exactly 1 match so position 3 must be given by C.
Leading to the unique solution 274