3 ms·
It's the standard xor solution: http://en.wikipedia.org/wiki/XOR_swap_algorithm http://en.wikipedia.org/wiki/XOR_swap_algorithm . FWIW, the other two solutions
by dalke 12y ago
It's the standard xor solution: http://en.wikipedia.org/wiki/XOR_swap_algorithm http://en.wikipedia.org/wiki/XOR_swap_algorithm . FWIW, the other two solutions suffer from overflow errors, though the +/- can be fixed by switching to unsigned ints.