Want a Free Job Posting?

Buy a job posting today and the second one is on us. For a limited time only. Act Now.

Interview Question

Interview Hyderābād (India)

given an array with N elements (~ 2n+1), which contains

  positive integers. All the numbers are repeating (i.e. they exist in pairs) except one. Find the non-repeating number.

Interview Answer

1 Answer


an xor (exclusive OR) of all the numbers will return the number repeating only once.

Aditya on Aug 1, 2011

Add Answers or Comments

To comment on this, Sign In or Sign Up.