7. Let the decimal representation of the positive integer $N$ consist only of the digits 1 and 2. By deleting digits from $N$, one can obtain all 10000 different positive integers formed by 9999 digits 1 and 1 digit 2. Find the minimum possible number of digits in $N$.
7. The minimum possible number of digits in $N$ is 10198.

For example, $N=\underbrace{1 \cdots 1}_{99 \uparrow} \underbrace{1 \cdots}_{100 \uparrow} 12 \underbrace{1 \cdots}_{100 \uparrow} \underbrace{2}_{98 \uparrow} \underbrace{1 \cdots 1}_{99 \uparrow}$.
For a number formed by 9999 digits 1 and 1 digit 2, if there are $100 m+n (0 \leqslant m, n \leqslant 99)$ digits 1 before the digit 2, then delete the other 2, leaving the $(m+1)$-th digit 2 from the left, and then delete the $99-n$ digits 1 before it and the $n$ digits 1 after it.
The following explains: The number of digits in $N$ cannot be less than 10198.
Obviously, in $N$, there do not need to be two digits 2 next to each other, otherwise one of them can be deleted.

Assume there are $k$ digits 2 in $N$, with $a_{0}$ digits 1 before the first 2, $a_{1}$ digits 1 between the first 2 and the second 2, and so on, with $a_{k}$ digits 1 after the $k$-th 2.
Let $s=a_{0}+a_{1}+\cdots+a_{k}$.
To ensure that the number obtained has only one 1 before the 2, at least $a_{0}-1$ digits 1 need to be deleted, thus, $s-\left(a_{0}-1\right)$ should be no less than 9999, i.e., $s-a_{0} \geqslant 9998$.

To ensure that the number obtained has $a_{0}+1$ digits 1 before the 2, the first 2 must be deleted and at least $a_{1}-1$ digits 1 must be deleted, thus, $s-a_{1} \geqslant 9998$.

To ensure that the number obtained has $a_{0}+a_{1}+1$ digits 1 before the 2, the first two 2s must be deleted and at least $a_{2}-1$ digits 1 must be deleted, thus, $s-a_{2} \geqslant 9998$.
By similar reasoning, for $i=0,1, \cdots, k-1$, we have $s-a_{i} \geqslant 9998$.
And to ensure that the 2 appears in the last position in the number obtained, we need $s-a_{k} \geqslant 9999$.
Adding these inequalities, we get
$$
\begin{array}{l}
(k+1) s-s \geqslant 9998(k+1)+1 \\
\Rightarrow k s>9998(k+1) \\
\Rightarrow s>9998+\frac{9998}{k} .
\end{array}
$$

Since there are also $k$ digits 2 in $N$, the number of digits in $N$ is more than
$$
9998+\frac{9998}{k}+k \geqslant 9998+2 \sqrt{9998}>10197 .
$$