998 = the sum of the smallest and the middle numbers;
1234 = the sum of the middle and the greatest number.
When you take the difference, the middle terms will cancel each other, and you will get what the question is asking for.
You do not need to find each number individually to get the answer.