<2017年4月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

统计

  • 随笔 - 57
  • 文章 - 7
  • 评论 - 0
  • 引用 - 0

常用链接

留言簿

随笔分类

随笔档案

文章分类

文章档案

Blog

Coder 必备技巧

Compiler for Wurq

搜索

  •  

最新评论

阅读排行榜

评论排行榜

【LeeCode 2017/06/13】 461. Hamming Distance
 1 class Solution {
 2 public:
 3     int hammingDistance(int x, int y) {
 4         int count = 0;
 5         for (int n = x ^ y; n; n >>= 1){
 6             if ((n & 1== 1)
 7                 count++;
 8         }
 9         return count;
10     }
11 };

posted on 2017-06-13 10:16 Wurq 阅读(147) 评论(0)  编辑 收藏 引用 所属分类: 【LeeCode 每日N题】