Find Odd Occurrence Element
You are given an array of 'N' elements. In this given array, each element appears an even number of times except one element which appears odd no. of times. Your task is to find the element which occurs an odd number of times.
For example :
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.
Input Format :
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.
Output format :
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.
Note :
You don’t have to print anything. It has already been taken care of. Just implement the given function.
Constraints :
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
Be the first one to answer
Add answer anonymously...
Top Jupiter Money Software Developer Intern interview questions & answers
Popular interview questions of Software Developer Intern
>
Jupiter Money Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app