annika-w
8/22/2017 - 11:18 AM

C++ Snippets

int count = 0;
for (int xor = a ^ b; xor != 0; xor = xor & (xor-1)) { 
  count++;
}