Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] The Hamming Distance by Moff
function hammingDistance(n, m) {
let result = 0;
while (n || m) {
if (n % 2 != m % 2)
result += 1;
n = Math.floor(n / 2);
m = Math.floor(m / 2);
}
return result;
}
July 7, 2017
Comments: