4. (20 points) In math class, each dwarf needs to find a three-digit number such that when 198 is added to it, the result is a number with the same digits but in reverse order. For what maximum number of dwarfs could all the numbers they find be different?
Answer: 70.

Solution: By the Pigeonhole Principle, the maximum number of gnomes is equal to the number of numbers that satisfy the condition of the problem.

Let the three-digit number be denoted as $\overline{x y z}$, where $x$ is the hundreds digit, $y$ is the tens digit, and $z$ is the units digit. Since the number $\overline{x y z}$ and the number $\overline{z y x}$ are considered together, then $x>0$ and $z>0$. According to the condition, $100 x + 10 y + z + 198 = 100 z + 10 y + x$. Transforming this, we get:

$$
99 z - 99 x = 198 \Leftrightarrow x = z - 2.
$$

Since $0 < x = z - 2 \leq 9$ and $z \leq 9$, then $0 < x \leq 7$. Therefore, there are 7 possible values for $x$. Each $x$ corresponds to one value of $z$, while $y$ can be any digit. Thus, the number of numbers that satisfy the condition of the problem is $7 \cdot 10 = 70$.