Sansa and XOR

  • + 0 comments

    Pythonic 1 liner:

    return reduce(lambda res, i: res ^ arr[i], range(0, len(arr), 2), 0) if len(arr) % 2 else 0