#K5766. Distinct Digit ID Check
Distinct Digit ID Check
Distinct Digit ID Check
You are given a series of identification numbers represented as strings that consist of digits. For each ID number, your task is to check if all digits are distinct.
An ID number is considered VALID if all its digits are unique; otherwise, it is INVALID. Mathematically, if we denote an ID number as a string s, it is valid if and only if:
$$|\text{set}(s)| = |s|$$
where \( |\text{set}(s)| \) represents the number of unique digits in s and \( |s| \) is the total length of the string.
Input is taken from standard input (stdin) and output should be written to standard output (stdout).
inputFormat
The first line of input contains an integer n representing the number of ID numbers to check. The following n lines each contain a single ID number, which is a string of digits.
Example:
4 1234567890 112345 9876543210 1234321
outputFormat
For each ID number, output a line containing "VALID" if the ID number has all distinct digits, or "INVALID" if it does not.
Example corresponding to the above input:
VALID INVALID VALID INVALID## sample
1
1234567890
VALID
</p>