How many integer numbers between 0 and 9999 are there that have exactly one digit 1 and exactly one digit 3?

The position of the digit $1$ can be chosen in $4$ ways, the position of the digit $3$ can be chosen in $3$ ways. The remaining two digits should belong to the set $\{0,2,4,5,6,7,8,9\}$ which has $8$ elements.

Hence the number of integers between 0 and 9999 that have exactly one digit 1 and exactly one digit 3 is $$4\cdot 3\cdot 8\cdot 8=768.$$


There is no good 1 digit number.

There are only $2$ good 2 digit number.

There are $7\cdot 2\cdot 1+2\cdot 2\cdot 8=46$ good 3 digit numbers.

There are $7\cdot 3\cdot 2\cdot 8 +2\cdot 3\cdot 8\cdot 8=720$ good 4 digit numbers.

So we have $768$ good numbers.