It's the only possible Answer. :)
- 738 -> the code doesn't contains the numbers 3,7,8
- 780 -> the 0 must be at first or second position
- 206 -> the 0 is not at the second position. Now we know the first digit is the 0
- 682 -> the well placed number must be the 2. Now we know the last digit is the 2. Also we know that the code does not contain a 6.
- 614 -> the 1 could not be the right number for the second digit, and the code does not contain a 6. So we know that the second digit was a 4.
- Now we have the correct code 042