Problema
A password is strong if it has at least 8 characters, at least one uppercase letter, at least one lowercase letter and at least one digit (English letters and 0–9).
Implement is_strong_password(password).
Input
password: The password to check (ASCII characters).
Output
Return true if all rules hold, otherwise false.
Vincoli
0 ≤ length of password ≤ 100
Esempi
Input:
password = "Secret123"
Output atteso:
expected = True
Input:
std::string password = "Secret123";
Output atteso:
bool expected = true;
Input:
string password = "Secret123";
Output atteso:
bool expected = true;
Spiegazione
9 characters with uppercase S, lowercase letters and digits: strong.
Input:
password = "password1"
Output atteso:
expected = False
Input:
std::string password = "password1";
Output atteso:
bool expected = false;
Input:
string password = "password1";
Output atteso:
bool expected = false;
Spiegazione
There is no uppercase letter, so it is not strong.
Riferimenti
Questa sfida è adattata per CodeUtility. Segui la traccia e i vincoli sopra.