You are viewing a single comment's thread. Return to all comments →
1. long long sumXor(long n) { long long count = 0; while (n > 0) { if ((n & 1) == 0) { count++; } n >>= 1; } easiest way as the constrain are to long and the give contrain in question is not fit for the sample case 8 10,11and 12. so use long long insted of long } return 1l << count; }
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 →