Answer:
The question can be re-stated as asking for the total number of permutations that can be derived from the following two groups of digits: AAABCD and AABBCD, where A, B, C and D are different.
The number of ways of choosing the digit A, to be used three times, out of the ten digits {0, 1, 2, ... 9} is 10. Having done that, the number of ways of selecting 3 from the remaining 9 digits is 9C3 = (9*8*7)/(3*2*1) = 84. Thus there are 10*84 = 840 combinations of the form AAABCD. You now need all the distinct permutations of these 6 digits. The total number of permutations of 6 digits is 6! but because 3 of the digits are the same, these permutations are not all distinct. In fact, there are 6!/3! = 120 distinct permutations. That makes a total of 840*120 = 100800 such numbers.
Next, the number of ways of choosing the digits A and B, each to be used twice, out of the ten digits {0, 1, 2, ... 9} is 10C2 = (10*9)/(2*1) = 45. Having done that, the number of ways of selecting C and D from the remaining 8 digits is 8C2 = (8*7)/(2*1) = 28. Thus there are 45*28 = 1260 combinations of the form AAABCD. You now need all the distinct permutations of these 6 digits. The total number of permutations of 6 digits is 6! but because 2 pairs of these digits are the same, these permutations are not all distinct. In fact, there are 6!/(2!*2!) = 180 distinct permutations. That makes a total of 1260*180 = 226800 such numbers.
The grand total is, therefore, 100800 + 226800 = 327600 6-digit numbers made from 4 distinct digits.