Task: How many passwords of 5 characters contain at least one character multiple?
Like: $a\quad a \quad b \quad c \quad \% \qquad$ or $ \quad b \quad 9 \quad d \quad i \quad d \qquad$ or $\quad d \quad d \quad d \quad a \quad a$
I have two ways I think that could be solved.
For each possibility: one character twice, threefold, fourfold ... a multiplication of possibilities. After that I create a sum of that:
Summarization of( twice: $95 \cdot 1 \cdot 94 \cdot 93 \cdot 92$ + threefold: $95 \cdot 1 \cdot 1 \cdot 94 \cdot 93$ + fourfold: $95 \cdot 1 \cdot 1 \cdot 1 \cdot 94$ ) $= 7 6405080 + 830490 + 8930= 77244500$
And another solution with variations: $|Var_5(95)|-|Var_5(94)| = 95^5- 94^4 = 398769151$
Question: I think both versions are not really correct because they do not cover the case if more than one character has multiples of itself like $\quad d \quad d \quad d \quad a \quad a$
How can I solve that problem ? I would appreciate every hint.