簡単 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用に調整されています。上記の説明と制約に従ってください。

他の人の解答から学ぶ

コミュニティの解答

まだ公開された解答がありません。この課題を解いて最初の解答を共有しましょう。