Find Unique pair in an array with pairs of numbers
Submissions: 2094   Accuracy:

29.06%

  Difficulty: Easy   Marks: 2

Given an array where every element appears twice except a pair (two elements). Find the elements of this unique pair.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains an Integer N denoting size of array and the second line contains N space separated elements.

Output:
For each test case, in new line print the unique pair in increasing order.

Constraints:
1<=T<=100
1<=N<=103
1<=A[i]<=103

Example:
Input:

2
6
2 2 5 5 6 7
4
1 3 4 1

Output:
6 7

3 4

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

Contributor: Arun Tyagi
Author: arun03


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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


to report an issue on this page.