问题详见:Hamming Distance
这是在优快云上的第一篇博客,开篇以C++的位操作的一个题目来打头阵。下面是问题描述:
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
Given two integers x and y, calculate the Hamming distance.
Note:
0≤x,