$\left[\begin{array}{ll}{[\text { Decimal numeral system }}\end{array}\right]$

From $A$ to $B 999$ km. Along the road, there are kilometer markers indicating the distances to $A$ and to $B$:

$0|999,1| 998, \ldots, 999 \mid 0$.

How many of them have only two different digits?
If the number on the left is composed of digits $a, b, c$, then the number on the left is composed of digits $a_{1}=9-a, b_{1}=9-b$ and $c_{1}=9$ $-c$. If $a=b=c$, then the required condition is satisfied. There are exactly 10 such columns.

Now let's assume that among the digits $a, b, c$ there are exactly two different ones. Among the digits $a_{1}, b_{1}, c_{1}$, there will be exactly the same two digits if and only if these two digits sum to 9. There are 5 such pairs of digits: $(0,9),(1,8),(2,7), \quad(3$, 6) and ( 4,5 ). There are exactly six three-digit numbers that can be written using two given digits: three of them are written with two digits $a$ and one digit $b$, and the other three are written with one digit $a$ and two digits $b$. This gives us another $5 \cdot 6=30$ columns.

## Answer

40 columns.