#K2086. Validate Reference Codes

    ID: 24658 Type: Default 1000ms 256MiB

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:

  1. The code must be exactly 10 characters long.
  2. The first three characters must be uppercase English letters (A–Z).
  3. The next five characters must be digits (0–9).
  4. The last two characters must be lowercase English letters (a–z).
  5. 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 TT, the number of test cases. Each test case begins with an integer NN, representing the number of reference codes. This is followed by NN lines, each containing a single reference code.

outputFormat

For each test case, output a single line containing NN 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>