def xor_em(lst):
    n = len(lst)
ret = 0
for i, el in enumerate(lst):
    count = (i + 1) * (n - i)
if count % 2:
    ret ^= el
return ret
print(xor_em([1, 2, 3]))
XOR on contiguous subarrays of an array