find the unique element

You have an array consisting of 2n+1 elements, n elements in it are
paired, i.e they occur twice in the array, however there is one
element which only appears once in the array. You need to find that
number in a single pass using constant memory,assuming that all are
positive numbers.

Comments

Post a Comment

Popular posts from this blog