Let the array be [1, 2, 3, 4, 4, 5]. In the given array ‘4’ occurs twice and the number ‘6’ is missing.
The very first line of input contains an integer ‘T’ denoting the number of test cases.
The first line of every test case contains an integer ‘N’ denoting the number of elements present in the array.
The second line of every test case contains ‘N’ space-separated integers denoting the elements present in the array.
For each test case, print the two space-separated integers denoting the repeating and the missing numbers, in the same order.
You do not need to print anything, it has already been taken care of. Just implement the given function.
Can you solve this in O(N) time and O(1) space complexities?
1 <= T <= 100
2 <= N <= 10^4
1 <= nums[i] <= N
Time Limit: 1 sec
Note:
Negative To The End
Sort 0s, 1s, 2s
Day 28 : Fake Coin Problem
Day 28 : Fake Coin Problem
Search In A Rotated Sorted Array II
Find Duplicate in Array