Split the feed by a bit
transcript
A feed has two lone ids. Every other id appears twice. Find the two lone ids.
The feed is one, two, one, three, two, five. Xor of everything cancels the pairs. What is left is three xor five. That is six.
Six is one, one, zero in binary. Its lowest set bit is worth two. Three has the bit and five does not.
Ids with the bit are two, three and two. Ids without it are one, one and five. Every pair lands in one group.
Xor the first group to get three. Xor the second group to get five. One pass, and no map.
A bit of the xor is one where the ids differ. A clear bit cannot separate them.
The method takes two passes over the feed. It needs no map and no sort. The memory is three integers.
Xor everything first. Split by the lowest set bit. Full breakdown in the lecture.