赞
踩
题目:
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
两个整数之间的汉明距离是相应位不同的位置数。
Given two integers x and y, calculate the Hamming distance.
现在你的工作是找出给定数字的所有成对之间的总汉明距离。
例:
Note:
0 ≤ x, y < 231.
Example:
Input: x = 1, y = 4
Output: 2
Explanation:
1 (0 0 0 1)
4 (0 1 0 0)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。