461 .汉明距离解题思路代码
解闷
每次比较最右边的二进制比特是否相同,不断向右移动即可
代码class solution { publicinthammingdistance (intx,int y ) { int res=0; while(x!=0||y!=0) { int a=x1; int b=y1; if(a!=b ) { res; } x=x1; y=y1; } return res; }
461 .汉明距离解题思路代码
解闷
每次比较最右边的二进制比特是否相同,不断向右移动即可
代码class solution { publicinthammingdistance (intx,int y ) { int res=0; while(x!=0||y!=0) { int a=x1; int b=y1; if(a!=b ) { res; } x=x1; y=y1; } return res; }
版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。