Saturday, 25 November 2017

Chef and Dolls Code Chef solution in C

#include <stdio.h>
 int main()
 {
int t,n,a,i;
scanf("%d",&t);
while(t--)
{
 int b[100000]={0},a[100000];
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
     scanf("%d",&a[i]);
     b[a[i]]++;
 }
 for(i=0;i<=100000;i++)
 {
     if(b[i]%2!=0)
     {
         printf("%d\n",i);
         break;
     }
 }
                }
                return 0;

}  

No comments:

Post a Comment