You are viewing a single comment's thread. Return to all comments →
Pythonic 1 liner:
return reduce(lambda res, i: res ^ arr[i], range(0, len(arr), 2), 0) if len(arr) % 2 else 0
Seems like cookies are disabled on this browser, please enable them to open this website
Sansa and XOR
You are viewing a single comment's thread. Return to all comments →
Pythonic 1 liner: