Each of the positions in the password can be filled in ways. There are therefore possible passwords.
A If repetition is not allowed, there are ways of choosing which different characters to use; and ways of arranging them to form the password. There are therefore passwords where all three characters are different.
B If two characters are repeated, and the third one is different, there are ways of choosing which two characters will make up the password; then there are two ways of choosing which of these character is the one to be repeated; finally, there are then three ways of choosing the position to be occupied by the non-repeated character. So there are passwords that use two different characters.
C There are ways of choosing a single character, and therefore passwords made up of just one character.
The total number of passwords is therefore