You are viewing a single comment's thread. Return to all comments →
For those struggling you might want to look at the pattern:
my solution:
def sumXor(n) binary = f'{n:b}' zero_count = binary.count('0') if n == 0: return 1 else: return 2**zero_count
n with binary rep of 10100 has 8 solutions
Process finished with exit code 0
Seems like cookies are disabled on this browser, please enable them to open this website
Sum vs XOR
You are viewing a single comment's thread. Return to all comments →
For those struggling you might want to look at the pattern:
my solution:
n with binary rep of 10100 has 8 solutions
Process finished with exit code 0