/*
INPUT:-
5 --> NO of testr cases
0
1
4
5
3
OUTPUT:-
2
*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n=0,j=0,t=0,res;
res=0L;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
res^=n;res^=j;
j++;
}
printf("%d\n",res^j);
return 0;
}
Example :--
4
0
4
1
3
Output:-
2 (Because the in the list 0 to 4 , element 2 is missing )
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.