Problème
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.
Contraintes
0 ≤ length of password ≤ 100
Exemples
Entrée :
password = "Secret123"
Sortie attendue :
expected = True
Entrée :
std::string password = "Secret123";
Sortie attendue :
bool expected = true;
Entrée :
string password = "Secret123";
Sortie attendue :
bool expected = true;
Explication
9 characters with uppercase S, lowercase letters and digits: strong.
Entrée :
password = "password1"
Sortie attendue :
expected = False
Entrée :
std::string password = "password1";
Sortie attendue :
bool expected = false;
Entrée :
string password = "password1";
Sortie attendue :
bool expected = false;
Explication
There is no uppercase letter, so it is not strong.
Références
Ce défi a été adapté pour CodeUtility. Suivez l'énoncé et les contraintes ci-dessus.