要点:
1 异或
2 数组中1的个数
class Solution {
public:
/**
*@param a, b: Two integer
*return: An integer
*/
int bitSwapRequired(int a, int b) {
// write your code here
int temp=a^b;
int count=0;
while(temp){
temp=temp&(temp-1);
count++;
}
return count;
}
};