ง่าย 0 ข้อที่แก้แล้ว อัตราผ่าน 0%

Password Rules Check

Check a password against simple strength rules.

โจทย์

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

ตัวอย่าง

ตัวอย่างที่ 1
อินพุต:
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.

ตัวอย่างที่ 2
อินพุต:
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 กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน

เรียนรู้จากคนอื่น

แนวทางจากชุมชน

ยังไม่มีวิธีทำที่เผยแพร่ ลองแก้โจทย์นี้เพื่อแชร์วิธีแรก