Problem Statement
Given an unsorted array of size N of positive integers.
One number 'A' from set {1, 2, …N} is missing and one number
'B' occurs twice in array. Find these two numbers.
Also, expected solution is O(n) time and constant extra space.
Example 1:
2
2
2 2
3
1 3 3
>> 2 1
>> 3 2
Example 2:
3
2
1 1
3
2 2 1
>> 1 2
>> 2 3