-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEZSPEAK.java
41 lines (37 loc) · 1011 Bytes
/
EZSPEAK.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// https://www.codechef.com/submit/EZSPEAK
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner input = new Scanner(System.in);
int t = input.nextInt();
while (t != 0) {
int count = 0;
int n = input.nextInt();
String str = input.next();
boolean is = true;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) != 'a' && str.charAt(i) != 'e' && str.charAt(i) != 'i' && str.charAt(i) != 'o' && str.charAt(i) != 'u' ) {
count++;
} else {
count = 0;
}
if (count >= 4) {
is = false;
break;
}
}
if (is) {
System.out.println("Yes");
}else {
System.out.println("No");
}
t--;
}
}
}