My issue
I’m not getting the desired output can anyone please tell me where is the mistake in the code?
My code
/* 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
{
// your code goes here
int count=0;
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
sc.nextLine();
for (int j=1;j<=T ;j++ ) {
String s=sc.nextLine();
char chararr[]=s.toCharArray();
for (int i=0;i<s.length() ;i++ ){
if(chararr[i]=='a'||chararr[i]=='e'||chararr[i]=='i'||chararr[i]=='o'||chararr[i]=='u'){
count=0;
}else{
count=count+1;
if(count==4){
System.out.println("NO");
break;
}
}
}
if(count!=4){
System.out.println("YES");
}
}
}
}
Problem Link: EZSPEAK Problem - CodeChef