Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Boring solution in Clear category for The Hamming Distance by Vulwsztyn
def checkio(n, m):
n=int(bin(n)[2:])
m=int(bin(m)[2:])
s=0
while(max(n,m)>=1):
print(n,m)
if n%10!=m%10:
s+=1
n=n//10
m=m//10
print(s)
return s
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert checkio(117, 17) == 3, "First example"
assert checkio(1, 2) == 2, "Second example"
assert checkio(16, 15) == 5, "Third example"
Dec. 2, 2016