题解 | 整数转化
整数转化
https://www.nowcoder.com/practice/c7df20a5a39e4357aecc1071e7fd523c
class Transform {
  public:
    int calcCost(int A, int B) {
        // write code here
        int count = 0;
        for (int i = 0; i < 32; i++) {
            if(A == 0 && B == 0) break;
            count += (A & 1) ^ (B & 1);
            A = A >> 1;
            B = B >> 1;
        }
        return count;
    }
};

