You are viewing a single comment's thread. Return to all comments →
C#:
public static long sumXor(long n) { long mask = n | n >> 1; mask |= mask >> 2; mask |= mask >> 4; mask |= mask >> 8; mask |= mask >> 16; mask |= mask >> 32; return 1L << (int)long.PopCount(mask ^ n); }
Seems like cookies are disabled on this browser, please enable them to open this website
Sum vs XOR
You are viewing a single comment's thread. Return to all comments →
C#: