Number of 3-digit numbers which do not contain more than 2 different digits. [1] Total number of 3-digit numbers which do not contain more than 2 different digits. 
[2] Total number of 5-digit numbers which do not contain more than 3 different digits. 
$\underline{\bf{My\; Try}}::$ I have formed different cases.
$\bullet$ If all digits are different, like in the form $aaa$, where $a\in \{1,2,3,.....,9\}$
$\bullet$ If all digits are different, like in the form $aba$ , where $a\in \{1,2,3,4,....,9\}$
$\bullet$ If one digit is zero and the other is non-zero, like $a00$ or $aa0$, where $a\in \{1,2,3,4,....,9\}$
But I do not understand how I can get a solution.
Please explain it to me.
 A: The fact that a $3$-digit number, by most definitions, cannot begin with $0$ complicates the analysis.
The case where there is only one digit is easy, there are $9$ possibilities.
We now count the $3$-digit numbers which have $2$ different digit. 
There are two subcases (i) $0$ is one of the digits, and (ii) all the digits are non-zero.
Case (i): There are $9$ choices for the other digit. For each such choice, either we have two $0$'s ($1$ number) or one zero. If we have one $0$, it can be out in one of $2$ places. That gives a total of $(9)(3)$.
Case (ii): There are $9$ choices for the first digit. We can either choose to use it twice, in which case we have $2$ choices of where to put the second occurrence, or use it once. The other digit can be chosen in $8$ ways, for a total of $(9)(3)(8)$.
Add up. We get $252$. 
Another way: There are $(9)(10)(10)$ $3$-digit numbers. There are $(9)(9)(8)$ with digits all different. Subtract. We get $252$.
We leave the more complicated $5$-digit question to you. It is slightly simpler to take more or less the second approach. It is easy to count the $5$-digit numbers, and also the $5$-digit numbers where the digits are all different. Some elements of the first approach will have to be borrowed to deal with the case exactly $4$ distinct digits.   
A: So you want three digit numbers that have either two different digits or only one digit?
The latter are easily found: $111, 222, \ldots, 999$. There are $9$ of these.
Next, consider $11X$ and $1X1$. Then $X$ can be any digit but $1$, giving a total of $9$ possibilities. This gives a total of $18$ numbers.
Similarly, consider $X11$. Then $X$ can be any digit but $1$ or $0$, giving a total of $8$ possibilities. This increases the total to $26$ numbers.
The same holds for each of $1, 2, \ldots, 9$, so you have $9\cdot 26 = 234$ possibilities. 
The final piece is the $9$ numbers $100, 200, \ldots 900$. Adding on these and the initial $9$ numbers, you get your final answer: $252$.
