#K53097. Strong Password Checker
Strong Password Checker
Strong Password Checker
You are given two integers la and lb representing the minimum and maximum allowed length of a password, respectively, followed by a list of passwords. A password is considered strong if it meets all the following criteria:
- The length of the password p satisfies $$l_a \leq |p| \leq l_b$$.
- It contains at least one lowercase letter.
- It contains at least one uppercase letter.
- It contains at least one digit.
- It contains at least one special character from the set
!@#$%^&*()-+
.
Your task is to check all the provided passwords against these criteria. Read the input from standard input (stdin) and output the result for each password on standard output (stdout), where each result is either Yes
(if the password is strong) or No
(otherwise).
inputFormat
The input is given from stdin with the following format:
- The first line contains two space-separated integers, la and lb.
- The second line contains an integer n, which is the number of passwords to check.
- Each of the next n lines contains a single password string.
outputFormat
For each password provided in the input, output a single line to stdout containing either Yes
if the password is strong or No
if it is not.
6 12
3
Abc123!
Password123
WeakP@ss
Yes
No
No
</p>