会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
ying_vincent
博客园
首页
新随笔
联系
管理
订阅
2017年2月23日
LeetCode: Number Complement
摘要: 注意这里num要%2再与1异或
阅读全文
posted @ 2017-02-23 16:00 ying_vincent
阅读(85)
评论(0)
推荐(0)
编辑
LeetCode: Hamming Distance
摘要: 1 public class Solution { 2 public int hammingDistance(int x, int y) { 3 int ans = 0; 4 while (x > 0 || y > 0) { 5 ans += (x % 2) ^ (y % 2); 6 x /= 2...
阅读全文
posted @ 2017-02-23 15:50 ying_vincent
阅读(105)
评论(0)
推荐(0)
编辑