#K63887. Digit and Letter Split
Digit and Letter Split
Digit and Letter Split
You are given T test cases. In each test case a single non-empty string s is provided. A string is considered valid if and only if it contains at least one digit and at least one letter. Otherwise, it is invalid.
Your task is to check each string and print YES
if the string is valid and NO
if it is not.
This can be formally written as ensuring that:
\[ (\exists\, c \in s : c \text{ is a digit}) \quad \text{and} \quad (\exists\, c \in s : c \text{ is an alphabet letter}) \]
inputFormat
The first line of input contains an integer T
denoting the number of test cases.
Each of the following T
lines contains a non-empty string s
which consists of alphanumeric characters.
outputFormat
For each test case, output a single line containing YES
if the string is valid (contains both at least one digit and at least one letter), otherwise output NO
.
1
abcdef
NO
</p>