You need to implement a function called count_valid_passwords that calculates the number of valid passwords based on given test cases. Each valid password is formed by the conditions specified in the function.
t (int): An integer representing the number of test cases.
test_cases (List[Tuple[int, List[int]]]): A list of tuples, where each tuple contains:
An integer n (the length of the password),
A list of integers arr of length n, with each integer representing a digit (0-9).
The function returns a list of integers, where each integer corresponds to the number of valid passwords for each test case. The password criteria require that a valid password can be formed using digits that are not present in the respective arr of each test case.
Requirements
The counting logic should check which digits (from 0 to 9) are not present in the arr for each test case.
Calculate the number of valid digits and derive the total possible valid password combinations according to the provided formula.
Implementation
Write the solution in a file named /app/solution.py. Ensure that the implementation adheres to the specified signature and meets the input/output requirements detailed above.