Assume the integer is 32 bit. XOR a and b, shift by 1 bit everytime -> want to check the XORed value at index 0 : just & 1 will do. Count the above calculated result: how many bit difference do a and ...