Lonely Integer : HackerRank Problem Solution

Lonely Integer : HackerRank Problem Solution


C Implementation:

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#define MAX 100000

int main() {
    int N,A[MAX],xor=0;
    scanf("%d",&N);
    for(int i=0;i<N;i++)
        {
        scanf("%d",&A[i]);
        xor=xor^A[i];
    }
    printf("%d",xor);
    return 0;
}