BAD ODD TIMES

3.2

22 votes
Problem

Once upon a times , there lived King Nihal who hated odd counting . He has received various gifts from different kings of other kingdoms on his birthday. There is one enemy king , and to make our king angry he will send odd number of gifts . As a sincere minister , its your task to find the enemy kingdom.

Input

T- number of test cases

N- number of gifts he received

N inputs each corresponding to the Kingdom from which the gift has come.

The gift number represents the Id of kingdom from which he received the gift

Output

Id of enemy kingdom

constraints 0<T<11 0<N<=10^6 0<id<10^4

Eg.

2

7

1 1 2 2 2 2 3

5

4 4 4 7 7

Output

3

4

Explanation

In the second test case he got 5 gifts from 2 kingdoms( id 4 and id 7 ), now kingdom 4 sends him odd number of gifts (3) so we find out that kingdom id 4 is his enemy.

Time Limit: 1
Memory Limit: 64
Source Limit:
Editor Image

?