My issue
what is string index out of bounds exception
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
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
String s=sc.nextLine();
int count=0;
for(int i=1;i<n;i++){
count=0;
if(s.charAt(i)=='a'|| s.charAt(i)=='e'||s.charAt(i)=='i'|| s.charAt(i)=='o'|| s.charAt(i)=='u'){
count++;
}
else{
break;
}
}
if(count==4){
System.out.println("YES");
}
else{
System.out.println("NO");
}
// your code goes here
}
}
}
Learning course: 1000 to 1400 difficulty problems
Problem Link: Easy Pronunciation Practice Problem in - CodeChef