How many times is the zero digit written

Write the integers from $1$ up to $222222$. How many times is the zero digit written?

Attempt: Let $a,$ $b$, $c$, and $d$ be digits such that they can all be equal to $1,2,3,4,5,6,7,8,9,0$; we have:

Starting counting from the digits of the units up to ten thousand:

From $10$ to $2220$ we have $222$ zeros.

From $10\text{a}$ to $220\text{a}$ we have $22 \cdot 10$ zeros

From $10\text{ab}$ to $220\text{ab}$ we have $22 \cdot 10 \cdot 10$ zeros

From $10\text{abc}$ to $220\text{abc}$ we have $22 \cdot 10^3$ zeros

From $10\text{abcd}$ to $20\text{abcd}$ we have $2 \cdot 10^4$ zeros.

How can I proceed? The answer is $108642$ but I don't get it


First consider the number of ways the last digit can be $0$. There are exactly $22222$ ways to fill the first 5 digits of $abcde0$.

Next we count the number of times the second digit is $0$. We notice that there are $2222$ ways to fill the first 4 digits of the number $abcd0*$ and for each of these configurations $*$ can take any value from 0 to 9 so we add $2222\times10$ to our total.

Similarly the third digit contributes $222\times100$ the fourth digit $22\times1000$ and the fifth digit $2\times10000$. Adding all these gives $20000+22000+22200+22220+22222=108642$