


Input array [5,5,6,4,6],If we look at the frequency of different elements in this array.We can see,4 appears an odd number of times, so our answer will be 4.
The first line of input contains a single integer 'T', representing the number of test cases.
Then the 'T' test cases follow.
The first line of each test case contains a number 'N' denoting the size of the array.
The second line contains 'N' space-separated distinct integers denoting elements of the array.
For each test case print the element which appears an odd number of times.
The output of every test case will be printed in a separate line.
You don’t have to print anything. It has already been taken care of. Just implement the given function.
1<= T <=100
1 <= N <= 10000
1 <= ARR[i] <= 10^8
Where 'T' denotes the number of test cases, 'N' denotes the number of elements in the array, and 'ARR[i]' denotes the 'i'th' element of the array 'ARR'.
Time limit : 1 sec
We will find the frequency of all elements by iterating over the whole array N times. On completion of iteration if the frequency of element is odd. We will return this element else keep on iterating.
We will scan the array from left to right and we will use the Hash to store frequency of each element. On encountering an element we will increase its hash value by 1.No we will scan again and check the Hash value of each element and we can find the element with odd frequency.
As XOR value of two same elements is zero and XOR of any element, say X, with 0 is X.We can use this fact in our problem, as if we XOR all elements of the array, then elements which appear even no. of time will always add 0 to result. So the result will have only one element which appears odd no. of time.
Algorithm :