#C5540. Validate Security PIN
Validate Security PIN
Validate Security PIN
You are given a security PIN and an integer N. Your task is to validate the PIN based on the following criteria:
- The PIN must be exactly N digits long.
- The PIN can only contain numeric digits (0-9).
- The PIN must contain at least one even digit. In other words, there must exist a digit d such that \(d \mod 2 = 0\).
- The PIN must not contain any repeating digits; each digit must be unique.
If the PIN meets all the criteria, output True
; otherwise, output False
.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains a single integer
N
, representing the required length of the PIN. - The second line contains the PIN as a string.
outputFormat
Print a single line to standard output (stdout) containing either True
if the PIN is valid according to the specifications, or False
otherwise.
4
1234
True