You are viewing a single comment's thread. Return to all comments →
long sumXor(long n) { long result=1; while(n){ if((n&1)==0)result*=2; n>>=1; } return result; }
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 →
long sumXor(long n) { long result=1; while(n){ if((n&1)==0)result*=2; n>>=1; } return result; }