Help me in solving HEADBOB problem

My issue

please check the fault

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n,flag;
	           
	    cin>>n;
	    char s[n];
	    int ind =0,not_ind =0;
	    for(int i=0; i<n+1;i++){
	 
	        cin>>s[i];
	      
	    }
	  for(int i=0; i<n+1;i++){
	    
	          if(s[i]=='I'){
	            ind++;
	        }
	        else if(s[i]=='Y')
	        not_ind++;
	        
	  }
	   if(ind>not_ind)
	   cout<<"INDIAN"<<endl;
	   else if(ind<not_ind)
	   cout<<"NOT INDIAN"<<endl;
	   else 
	   cout<<"NOT SURE"<<endl;
	}
	return 0;
}

Problem Link: HEADBOB Problem - CodeChef

You are declaring character array of n size but then you are taking input n+1 times. Only take input n times.

for(int i=0;i<n;i++){
cin>>s[i];
}
  1. Your array size is n and you are taking input until n+1.
  2. You need to print Indian even if a single ‘I’ exists in the input string, but you are checking if count of ‘I’ is more than ‘Y’.

Solution:
1)Just take input upto n by running your loops for i<n.
2) if(ind>0)cout<<“INDIAN”<<endl;
else if (not_ind>0)cout<<“NOT INDIAN”<<endl
else cout<<“NOT SURE”<<endl