#K44827. Password Validation Challenge
Password Validation Challenge
Password Validation Challenge
You are given an integer \(N\) and a string representing a password. Your task is to validate the password based on the following criteria:
- The password must be exactly \(N\) characters long.
- The password must contain at least one uppercase letter (e.g., A-Z).
- The password must contain at least one lowercase letter (e.g., a-z).
- The password must contain at least one digit (0-9).
- The password must contain at least one special character from the set: @, #, $, %, &, *.
- The password must not contain any spaces.
If all conditions are met, print YES
; otherwise, print NO
.
inputFormat
The input is read from standard input (stdin) and contains two lines. The first line is an integer (N) representing the expected password length, and the second line is the password string.
outputFormat
Print a single line to standard output (stdout): YES
if the password satisfies all criteria; otherwise, print NO
.## sample
10
Passw0rd@!
YES