标签:res distance public return code bsp span count div
class Solution { public: int hammingDistance(int x, int y) { int res = x ^ y; int count = 0; int m; while(res){ m = res & (res - 1); count++; res = m; } return count; } };
leetcode 461. Hamming Distance
标签:res distance public return code bsp span count div
原文地址:https://www.cnblogs.com/ymjyqsx/p/9655839.html