Alle Herausforderungen
Einfach 0 gelöst 0% Erfolgsquote

Password Rules Check

Check a password against simple strength rules.

Problem

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.

Einschränkungen

0 ≤ length of password ≤ 100

Beispiele

Beispiel 1
Eingabe:
password = "Secret123"

Erwartete Ausgabe:
expected = True
Eingabe:
std::string password = "Secret123";

Erwartete Ausgabe:
bool expected = true;
Eingabe:
string password = "Secret123";

Erwartete Ausgabe:
bool expected = true;

Erläuterung

9 characters with uppercase S, lowercase letters and digits: strong.

Beispiel 2
Eingabe:
password = "password1"

Erwartete Ausgabe:
expected = False
Eingabe:
std::string password = "password1";

Erwartete Ausgabe:
bool expected = false;
Eingabe:
string password = "password1";

Erwartete Ausgabe:
bool expected = false;

Erläuterung

There is no uppercase letter, so it is not strong.

Referenzen

Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.

Von anderen lernen

Community-Lösungen

Noch keine veröffentlichten Lösungen. Löse die Aufgabe und teile als Erster eine Lösung.