How many different 4-digit numbers have exactly two different digits?
There are 576 four digit numbers that have exactly 2 different digits!
Neither digit is zero, 2 of each one
9C2*4!/(2!2!) = 9C2* 6 = 36*6 = 216
Zero plus one other number, 2 of each
9*3!/2! = 27
neither digit is zero, 3 of one and 1 of the other.
9C2*2*4 = 36*8 = 288
One digit is zero, 3 of one and 1 of the other.
9*3 = 27
216+27+288+27 = 558
Note: There is room here for error.