Algorithm
C++ Exercises: Bit Operation
Exercises: 461. Hamming Distance Calculate the number of positions at which the corresponding bits are different. Solution: Do XOR and find the number of 1. class Solution { public: int hammingDistance(int x, int y) { int tmp = x ^ y; Read more…