class Transform {
public:
int calcCost(int A, int B) {
// A 和 B 异或后统计结果中的1的个数
int temp = A ^ B;
int counter = 0;
while(temp > 0)
{
if(temp & 1 == 1) counter++;
temp = temp >> 1;
}
return counter;
}
};