My attempt:
No of digits that don't contain $3$ $=(8 \cdot 9 \cdot 9 + 8 \cdot 9 \cdot 9 \cdot 9)$.
Digits that contain $3$ $=9900-(8 \cdot 9 \cdot 9+ 8 \cdot 9 \cdot 9 \cdot 9)= 3420$, but this answer is wrong how?
My attempt:
No of digits that don't contain $3$ $=(8 \cdot 9 \cdot 9 + 8 \cdot 9 \cdot 9 \cdot 9)$.
Digits that contain $3$ $=9900-(8 \cdot 9 \cdot 9+ 8 \cdot 9 \cdot 9 \cdot 9)= 3420$, but this answer is wrong how?
On
It's the same as how many digit 3s you need to list all of the numbers from 0100 to 9999 (with leading zeros).
And that is again the same as how many 3s you need to list the numbers from 0000 to 9999, minus how many 3s you need to list the numbers from 00 to 99.
The two latter counts are easy: each of them is a tenth of all the 40,000 (respectively, 200) digits you're going to print in total.
You correctly calculated the number of digits containing the number $3$, but not the number of times the digit $3$ appears in the numbers. For example, in the number $333$, the digit $3$ appears three times, but you only count it once.