Password Strength Checker - Problem
Given a password string, check if it meets all the strength requirements.
Requirements:
- Minimum 8 characters long
- Contains at least one uppercase letter (A-Z)
- Contains at least one lowercase letter (a-z)
- Contains at least one digit (0-9)
- Contains at least one special character (!@#$%^&*)
Return true if the password is strong, false otherwise.
Input & Output
Example 1 — Strong Password
$
Input:
password = "Password123@"
›
Output:
true
💡 Note:
Length is 12 (≥8), contains uppercase 'P', lowercase letters 'assword', digits '123', and special character '@'. All requirements satisfied.
Example 2 — Too Short
$
Input:
password = "Pass1@"
›
Output:
false
💡 Note:
Length is only 6 characters, which is less than the required minimum of 8 characters.
Example 3 — Missing Special Character
$
Input:
password = "Password123"
›
Output:
false
💡 Note:
Has length ≥8, uppercase, lowercase, and digits, but missing a special character from the set !@#$%^&*.
Constraints
- 1 ≤ password.length ≤ 100
- Password contains only ASCII characters
- Special characters are limited to: !@#$%^&*
Visualization
Tap to expand
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code