Given an array A containing 2*N+2 positive numbers, out of which 2*N numbers exist in pairs whereas the other two number occur exactly once and are distinct. Find the other two numbers (in ascending order).
You do not need to read or print anything. Your task is to complete the function singleNumber() which takes the array as input parameter and returns a list of two numbers which occur exactly once in the array.
Expected Time Complexity: O(n) Expected Space Complexity: O(1)
1 <= length of array <= 106 1 <= Elements in array <= 5 * 106