博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LeetCode之461. Hamming Distance
阅读量:4633 次
发布时间:2019-06-09

本文共 275 字,大约阅读时间需要 1 分钟。

------------------------------------------------------------------

 

AC代码:

public class Solution {    public int hammingDistance(int x, int y) {        return Integer.toString(x^y,2).replaceAll("0","").length();    }}

 

 

题目来源: 

 

转载于:https://www.cnblogs.com/cc11001100/p/6240408.html

你可能感兴趣的文章
【NOIP校内模拟】T2 华莱士(环套树)
查看>>
lists,tuples and sets of Python
查看>>
Superset配置hive数据源
查看>>
查询Master下的系统表和系统视图获取数据库的信息和简单的渗透测试
查看>>
GET和POST的区别
查看>>
Sublime Text 3 及Package Control 安装(附上一个3103可用的Key)
查看>>
jvm 性能调优
查看>>
算法(第四版)C# 习题题解——1.3
查看>>
LTE QCI分类 QoS
查看>>
【Flask】flask+uwsgi+nginx环境部署
查看>>
Get MAC address using POSIX APIs
查看>>
bzoj2120
查看>>
基于uFUN开发板的心率计(一)DMA方式获取传感器数据
查看>>
【dp】船
查看>>
oracle, group by, having, where
查看>>
⑥python模块初识、pyc和PyCodeObject
查看>>
object-c中管理文件和目录:NSFileManager使用方法
查看>>
Kibana:分析及可视化日志文件
查看>>
nodejs pm2使用
查看>>
物联网兴起 嵌入式系统安全日益受关注
查看>>