#C10290. Valid Discount Code
Valid Discount Code
Valid Discount Code
In this problem, you are given one or more discount codes. A discount code is considered valid if and only if it meets all of the following criteria:
- It contains at least one uppercase letter (A-Z).
- It contains at least one digit (0-9).
- It does not contain any repeating characters.
Your task is to determine whether each provided discount code is valid. For each code, print Valid
if it meets the criteria and Invalid
otherwise.
Note: Each discount code will be processed independently and the check is case-sensitive.
inputFormat
The first line contains an integer N (1 ≤ N ≤ 100), representing the number of discount codes. Each of the following N lines contains a discount code, which is a non-empty string of at most 100 characters.
outputFormat
For each discount code, output a single line printing either Valid
or Invalid
based on whether the discount code meets all the criteria.
6
A1B2C3
123456
ABCDEF
A1X
AAA111
X1Y2Z3
Valid
Invalid
Invalid
Valid
Invalid
Valid
</p>