#C7259. Strong Password Checker
Strong Password Checker
Strong Password Checker
You are given a list of passwords and your task is to determine whether each password is strong.
A password is considered strong if it satisfies all of the following criteria:
- Its length is at least \(7\) characters.
- It contains at least one uppercase letter.
- It contains at least one lowercase letter.
- It contains at least one digit.
- It contains at least one special character from the set \(\{!,@,#,$,%,^,&,*\}\).
For each password, print YES if it is strong, otherwise print NO.
inputFormat
The first line contains an integer \(q\) representing the number of passwords. Each of the following \(q\) lines contains one password string.
outputFormat
For each password, output a single line containing YES
if the password is strong, or NO
if it is not.
4
A1b#def
A1bdefgH
abcdefg1!
Abcdefg1
YES
NO
NO
NO
</p>