#K57282. Beautiful Substrings
Beautiful Substrings
Beautiful Substrings
You are given an integer \(T\) and \(T\) test cases. Each test case contains a string \(S\) consisting of only lowercase English letters. A string is considered beautiful if it contains at least one vowel and at least one consonant.
The vowels are defined as \(\{a, e, i, o, u\}\). Formally, a string \(S\) is beautiful if and only if: \[ \exists\; i \quad \text{such that} \quad S[i] \in \{a,e,i,o,u\} \] and \[ \exists\; j \quad \text{such that} \quad S[j] \notin \{a,e,i,o,u\} \]
Your task is to determine for each test case whether the string is beautiful. Output 1 if it is, otherwise output 0.
Note: Process the input from stdin and print the result to stdout for each test case on a separate line.
inputFormat
The first line contains an integer \(T\), the number of test cases. Each of the next \(T\) lines contains a string \(S\).
Example:
3 apple sky beautiful
outputFormat
For each test case, output a single line containing either 1
if the string is beautiful or 0
if it is not.
Example:
1 0 1## sample
2
apple
sky
1
0
</p>