Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
native_multiplication_table solution in Uncategorized category for Multiplication Table by Jon_Red
def checkio(first,second):
t=[[(int(x),int(y))for x in bin(second)[2:]]for y in bin(first)[2:]]
a=sum(int(''.join(str(x&y)for x,y in i),2)for i in t)
o=sum(int(''.join(str(x|y)for x,y in i),2)for i in t)
x=sum(int(''.join(str(x^y)for x,y in i),2)for i in t)
return a+x+o
if __name__ =='__main__':
# self-checks
assert checkio(4,6)==38
assert checkio(2,7)==28
assert checkio(7,2)==18
June 30, 2020