Element that appears once where every element occurs twice
Submissions: 7710   Accuracy:

57.79%

  Difficulty: Easy   Marks: 2

Given an array of integers, every element appears twice except for one. Find that single one in linear time complexity and without using extra memory.

 

Input:

The first line of input consists number of the test cases. The description of T test cases is as follows:

The first line of each test case contains the size of the array, and the second line has the elements of the array.

 


Output:

In each separate line print the number that appears only once in the array.


Constraints:

1 ≤ T ≤ 70
1 ≤ N ≤ 100
0 ≤ A[i] ≤ 100000


Example:

Input:

1
11
1 2 4 3 3 2 5 6 1 6 5

Output:

4

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: madhuradlakha


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.