Chkhhanov N.X.

In the natural number $A$, the digits were rearranged to obtain the number $B$. It is known that $A-B=\underbrace{1 \ldots 1}_{n}$. Find the smallest possible value of $n$.

#
Numbers obtained from each other by rearranging digits have the same remainder when divided by 9, which means their difference is divisible by 9. Therefore, the sum of the digits of the difference, equal to $n$, is also divisible by 9, hence $n \geq 9$.

The value $n=9$ can be obtained, for example, as follows: $9012345678-8901234567=111111111$.

Answer

## 9.