Possible Duplicate:
Find two missing numbers
I been thinking for a while and can't seem to get an answer to this... So an array with n-2 unique integers in the range from 1 to n and O(1) space in addition to the space used by the array is given. How can you find the two integers from 1 to n that is missing in the array in O(n) time?
So for example, a = [4,3,1,6] and O(1) extra space How can you find 2, 5 in O(n) time?