โจทย์
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.
เงื่อนไข
0 ≤ length of password ≤ 100
ตัวอย่าง
อินพุต:
password = "Secret123"
ผลลัพธ์ที่คาดหวัง:
expected = True
อินพุต:
std::string password = "Secret123";
ผลลัพธ์ที่คาดหวัง:
bool expected = true;
อินพุต:
string password = "Secret123";
ผลลัพธ์ที่คาดหวัง:
bool expected = true;
คำอธิบาย
9 characters with uppercase S, lowercase letters and digits: strong.
อินพุต:
password = "password1"
ผลลัพธ์ที่คาดหวัง:
expected = False
อินพุต:
std::string password = "password1";
ผลลัพธ์ที่คาดหวัง:
bool expected = false;
อินพุต:
string password = "password1";
ผลลัพธ์ที่คาดหวัง:
bool expected = false;
คำอธิบาย
There is no uppercase letter, so it is not strong.
แหล่งอ้างอิง
โจทย์นี้ปรับให้เหมาะกับ CodeUtility กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน