博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Leetcode 461. 汉明距离(DAY 83)---- Leetcode Hot 100总结
阅读量:192 次
发布时间:2019-02-28

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

原题题目

在这里插入图片描述


代码实现(首刷自解)

class Solution {
public: int hammingDistance(int x, int y) {
int judge = x^y,ret = 0; while(judge) {
if((judge & 1)) ret++; judge/=2; } return ret; }};

转载地址:http://xbni.baihongyu.com/

你可能感兴趣的文章