Help me in solving EZSPEAK problem

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

@greeshma1nese
plzz refer the following solution for debugging

import java.util.*;
import java.lang.*;
import java.io.*;
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();     //size of string
		    sc.nextLine();
		    String s=sc.next();     //string input
		    s.toLowerCase();
		    if(n<4)
		    { 
		        System.out.println("YES");
		        }
		    else{ 
		        int count=0;
		        for(int i=0; i<s.length(); i++)
		        {
		            if(count==4)
		            { 
		                break; 
		                
		            }
		            if(s.charAt(i)=='a' || s.charAt(i)=='e' || s.charAt(i)=='i' || s.charAt(i)=='o' || s.charAt(i)=='u' )
		            {
		                count=0; 
		                
		            }
		            else 
		            {
		                count++;
		            }
		        }
		        if(count==4)
		        { 
		            System.out.println("NO");
		        }
		        else
		        {
		            System.out.println("YES");
		            
		        }
		    }
		}
	}
}