Question:Given $0-9$ digits, $0$ can be leading digit. 

a.) How many ways to form a $6$ digits license plates?

b.)If only one digit can be occur more than once, and occurred $3$ times. How many ways are there?

It's easy to see that part a is $10^6$. But I'm stuck on part b, my interpretation is that first we have to count the ways that the digits only occur once. Then we count the second task which is one of the digits occurred $3$ times. I'm stuck on doing the calculation at this moment, any suggestion?

(Note part b is still a $6$ digits license plate)