Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
11-liner: sum of all operations(and, or & xor) at once solution in Clear category for Multiplication Table by Stensen
def checkio(a, b, answer = 0):
a, b = map(lambda i: bin(i)[2:], [a, b])
for i in a:
AND = OR = XOR = ''
for j in b:
AND += str(int(i) and int(j))
OR += str(int(i) or int(j))
XOR += str(int(i) ^ int(j))
answer += sum([int(AND, 2), int(OR, 2), int(XOR, 2)])
return answer
Oct. 31, 2020
Comments: