Counting $5$-character long Passwords with a Fixed Starting and Ending Points

combinatoricscombinatorics-on-wordspermutations

Students are required to create $5$-character long passwords to access the library. The characters must be from lowercase letters or digits. Each password must start with a lowercase letter and end with a digit and contain at most $2$ digits. How many valid passwords are there?
Is this solution correct?
$(26×(26^3) ×10) + (26×(26^2×10)×10)$

Best Answer

26 possibilities for the first character
10 possibilities for the last character (a digit)

2 cases: there is a 2nd digit or there isn't.

case 1 : there is a 2nd digit
digit can go in any of 3 spots.
$T_1 = 3 \times 10 \times 26^2.$

case 2 : there is no 2nd digit
$T_2 = 26^3.$

Final answer:

$$26 \times 10 \times [T_1 + T_2].$$