This Program is giving the correct output in codeBlocks but showing wrong answer in codechef.
Problem Statement
My Program:-
#include<iostream>
using namespace std;
int main()
{
int T,N,h,K,countC,countS;
string s;
cin>>T;
cout<<endl;
while(T>0){
cin>>N>>K;
cin>>s;
h=s.length();
countC=0;countS=0;
for(int i=0;i<h; i++){
if(isupper(s[i])==1)
countC++;
else countS++;
}
if (countC==K)
cout<<"chef";
else if (countS==K)
cout<<"brother";
else if(K==0){
if(countC==N)
cout<<"brother";
else
cout<<"chef";
}
else if (countS>K &&countC<K)
cout<<"chef";
else if (countC>K &&countS<K)
cout<<"brother";
else if(countS<K&&countC<K)
cout<<"both";
else cout<<"none";
T--;
}
return 0;
}