https://www.codechef.com/submit/HEADBOB

I having problem in understanding the constraints of codechef problem,
like i wrote the code ,and it ran successfully on my c++ compiler ,but when i submit it on codechef ide ,it shows the wrong answer
my code is as followed
#include
#include<string.h>
using namespace std;

int main()
{
int T;
int N;
// char str[1000];
int i;
int len;
int c=0;

cout<<"\n enter the number of people of whom gestures were observed"<<endl;

cin>>T;

while(T>0)
{   char str[1000]="";
	cout<<"enter the no of gestures observed in people in the form of Y,N,I"<<endl;
	cin>>N;
	cout<<"enter the list of gestures"<<endl;
    
	for(i=0;i<N;i++)
	{
		cin>>str[i];
	}
	len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(str[i]=='Y')
		{
		
		cout<<"NOT INDIAN"<<endl;
		c=1;
		break;
	}
		if(str[i]=='I')
		{
		
		cout<<"INDIAN"<<endl;
		c=1;
		break;
	}
	else
	continue;	
		
	}
	
	if(c==0)
	cout<<"NOT SURE"<<endl;
	
	T--;
}

return(0);

}
please help

you should also give the question link, your solution link while asking a question.
probably your code is wrong because you shouldn’t print that english text like “enter the no” and all

you should not print anything like :

my solution

# cook your dish here
for _ in range(int(input())):
    n=int(input())
    s=input()
    x=s[0]
    if s.count("N")==n:
        print("NOT SURE")
    elif s.count("I")>0:
        print("INDIAN")
    else:
        print("NOT INDIAN")

okay, i will keep this in mind,thanku so much

1 Like

thanku so much,i got it