#K52417. Password Strength Checker
Password Strength Checker
Password Strength Checker
You are given a list of passwords. A password is considered Strong if it meets all the following conditions:
- Its length is at least $8$ characters.
- It contains at least one uppercase letter (A-Z).
- It contains at least one lowercase letter (a-z).
- It contains at least one digit (0-9).
- It contains at least one special character from the set:
! @ # $ % ^ & * ( )
.
Otherwise, the password is considered Weak. Your task is to process an input of passwords from stdin
and output, for each password, whether it is "Strong" or "Weak" to stdout
, with each result on a new line.
inputFormat
The input will be read from stdin
and will have the following format:
N password1 password2 ... passwordN
Where N
is the number of passwords, followed by N
lines each containing a password.
outputFormat
For each password, output a single line to stdout
containing either "Strong" or "Weak" based on the criteria provided.
5
Password123!
weakpass
Str0ngPa$$word
noSpecialChar1
A@1bC
Strong
Weak
Strong
Weak
Weak
</p>