Problem of the day
Input: 'N' = 6, 'NUMS' = [1, 1, 2, 3, 4, 4]
Output: 2 3
Here in the given array we can see that 2 and 3 occur 1 time which is an odd number. Hence, the output will be 2 and 3.
The first line of the input contains an integer, 'T’, denoting the number of test cases.
The first line of each test case will contain a single integer ‘N’, denoting the size of the array.
The second line of each test case contains ‘N’ space-separated integers denoting elements of the array.
For each test case, print the two numbers in increasing order separated by space which appear an odd number of times in the given array.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= 'T' <= 10
2 <= 'N' <= 10^4
1 <= 'NUMS[i]' <= 10^5
Time Limit: 1 sec
2
6
1 1 2 3 4 4
2
1 2
2 3
1 2
For the first test case,
'N' = 6 and 'NUMS' = [1, 1, 2, 3, 4, 4]
Here in the given array we can see that 2 and 3 occur 1 time which is an odd number. Hence, the output will be 2 and 3.
For the second test case,
'N' = 2 and 'NUMS' = [1, 2]
Here in the given array we can see that 1 and 2 occur 1 time which is an odd number. Hence, the output will be 1 and 2.
2
4
8 2 2 7
4
3 1 3 5
7 8
1 5