You have integer array of 2n+2 elements, in which n numbers are having its 2 entries.
You have to find the 2 numbers which is unique in the the array.
e.g:
{1,9,8,6,7,5,3,4,2,2,9,8,7,6,4,3,1,10}
you program should give 5,10
1. do xor of all element of array, say it is x
2. prepare array of xor group of two element
3. now xor with all group of two element , group which give zero will b the result
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks