https://www.codechef.com/CCSTART2/problems/FINDMELI

#include
using namespace std;
int main()
{
int n,i,k,count=0;
cin>>n>>k;

int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=0;i<n;i++)
{

if(a[i]==k)
{

count++;
}

}
if(count==1||count>1)

{
cout<<count<<endl;
}
else
{
cout<<"-1"<<endl;
}

return 0;
}

CAN someone tell me my mistake .The compiler says wrong answer

1 Like

NEVER MIND GUYS FOUND THE PROBLEM

int value array repeat then count will be increase for example if n=4 and k=2 a[i]=1 2 2 3 then it will be print 2.

*if