#K2086. Validate Reference Codes
Validate Reference Codes
Validate Reference Codes
You are given a list of reference codes. Your task is to determine whether each code is valid based on the following criteria:
- The code must be exactly 10 characters long.
- The first three characters must be uppercase English letters (A–Z).
- The next five characters must be digits (0–9).
- The last two characters must be lowercase English letters (a–z).
- The code must not contain any spaces or special characters.
A valid code satisfies the regular expression
^ [A-Z]{3}\d{5}[a-z]{2} $Print the validation result for each code as either True
or False
.
inputFormat
The first line of input contains an integer , the number of test cases. Each test case begins with an integer , representing the number of reference codes. This is followed by lines, each containing a single reference code.
outputFormat
For each test case, output a single line containing boolean values (True
or False
) separated by a space. Each boolean represents whether the corresponding reference code is valid.## sample
1
3
ABC12345de
AB123456ef
XYZ98765gh
True False True
</p>