3 ms·
Clever solution. Sometimes XOR seems magical (like with the XOR swap trick). Though in hindsight, it seems like the question was designed for the solution, not
by tlrobinson 18y ago
Clever solution.
Sometimes XOR seems magical (like with the XOR swap trick). Though in hindsight, it seems like the question was designed for the solution, not vice versa. XOR just happens to do exactly what we need in this case.