Mercury Systems Interview Question

Write a C++ program that finds the integer that appears once in an array where every other integer appears twice.

Interview Answer

Anonymous

Dec 17, 2019

I tried utilizing a for loop, but wasn't able to figure out what logic to use to find the correct answer. Had I been thinking clearly, I would have figured out that all I needed to do was use the for loop to take the first element of the array and XOR it with every other element in the array.