4 ms·
The xor, sum pair can't distinguish missing 11, 0 from missing 10, 1.
by Strilanc 6y ago
The xor, sum pair can't distinguish missing 11, 0 from missing 10, 1.
- virgilp 6y agoAh, you're right, I didn't think it through. It does feel like there must be a way to play with the bits so that you can retrieve it in a single pass, though - that'd be a much more interesting problem :). (of course, you can do it with sum + product, but that's going to be fairly expensive for large numbers)