本文共 301 字,大约阅读时间需要 1 分钟。
You are given two numbers A and B. Write a program to count number of bits needed to be flipped to convert A to B.
1. Calculate XOR of A and B. a_xor_b = A ^ B 2. Count the set bits in the above calculated XOR result. countSetBits(a_xor_b)
转载地址:http://jexti.baihongyu.com/