Apr 15, 2008

array question again

Suppose you are having an array of n integer. All the elements in the array are unique
except one element. That one special element in array is repeating in array in order of power two(means even repetition)

example - 1 2 3 4 5 6 5 7 8

all element in this array are unique except 5.. and 5 is repeating 2 times (power of 2).
we need an algo to find this special element in array

1 comment:

Matka/HTML said...

what is the condition, is it "power of two" or "even"? If you notice, not every even number can be "power of two". :D