Amazon Interview Question: given an array of nonnegative... | Glassdoor

Interview Question

Intern Software Development Engineer Interview

given an array of nonnegative integers and the size of the

  array, within the array every number except one number appears an even number of times, the other is appears an odd number of times, write a function to return the number that appears an odd number of times.

Interview Answer

1 Answer


You can use bitwise XOR operation to answer this question. Detail answer can be found here

thanh nguyen on Dec 24, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.