=====Problem Statement=====
ABCXYZ company has up to 100 employees.
The company decides to create a unique identification number (UID) for each of its employees.
The company has assigned you the task of validating all the randomly generated UIDs.

A valid UID must follow the rules below:

It must contain at least 2 uppercase English alphabet characters.
It must contain at least 3 digits (0-9).
It should only contain alphanumeric characters (a-z, A-Z & 0-9).
No character should repeat.
There must be exactly 10 characters in a valid UID.

=====Input Format=====
The first line contains an integer T, the number of test cases.
The next T lines contains an employee's UID.

=====Output Format=====
For each test case, print 'Valid' if the UID is valid. Otherwise, print 'Invalid', on separate lines. Do not print the quotation marks.

Difficulty: introductory

Starter code:

# Enter your code here. Read input from STDIN. Print output to STDOUT

Solutions:
import re
n = int(input())
upper_check = r'.*([A-Z].*){2,}'
digit_check = r'.*([0-9].*){3,}'
alphanumeric_and_length_check = r'([A-Za-z0-9]){10}$'
repeat_check = r'.*(.).*\1'
for i in range(n):
    uid_string = input().strip()
    upper_check_result = bool(re.match(upper_check,uid_string))
    digit_check_result = bool(re.match(digit_check,uid_string))
    alphanumeric_and_length_check_result = bool(re.match(alphanumeric_and_length_check,uid_string))
    repeat_check_result = bool(re.match(repeat_check,uid_string))    
    if upper_check_result and digit_check_result and alphanumeric_and_length_check_result and not repeat_check_result:
        print('Valid')
    else:
        print('Invalid')


import re

def __starting_point():
    t = int(input().strip())
    
    for _ in range(t):
        uid = "".join(sorted(input()))
        if (len(uid) == 10 and
            re.match(r'', uid) and 
            re.search(r'[A-Z]{2}', uid) and
            re.search(r'\d\d\d', uid) and
            not re.search(r'[^a-zA-Z0-9]', uid) and
            not re.search(r'(.)\1', uid)):
            print("Valid")
        else:
            print("Invalid")

__starting_point()