Example 2 (2004 National High School Competition Question) Let the three-digit number $n=\overline{a b}$. If $a, b, c$ can form an isosceles (including equilateral) triangle, then the number of such three-digit numbers $n$ is ( ).
A. 45
B. 81
C. 165
D. 216
Solution: Choose C. Reason: For $a$, $b$, and $c$ to form the sides of a triangle, they must all be non-zero, i.e., $a, b, c \in\{1,2, \cdots, 9\}$.
(1) If they form an equilateral triangle, assume the number of such three-digit numbers is $n_{1}$. Since all three digits in the three-digit number are the same, then $n_{1} = C_{9}^{1} = 9$.
(2) If they form an isosceles (non-equilateral) triangle, assume the number of such three-digit numbers is $n_{2}$. Since the three-digit number contains only 2 different digits, denoted as $a$ and $b$. Note that the positions of the two equal sides and the base can be interchanged, so the number of digit pairs $(a, b)$ is $2 C_{9}^{2}$. However, when the larger number is the base, assuming $a > b$, it must satisfy $b < a < 2b$. In this case, there are 20 combinations of digits that cannot form a triangle, as shown in the table below:

At the same time, for each digit pair $(a, b)$, the 2 digits can be placed in 3 positions in $C_{3}^{2}$ ways. Therefore, $n_{2} = C_{3}^{2} \left(2 C_{9}^{2} - 20\right) = 156$.
In summary, $n = n_{1} + n_{2} = 165$.