Created
June 6, 2014 17:42
-
-
Save jo32/64e708e75a1623167e74 to your computer and use it in GitHub Desktop.
azran_legacy_puzzle_025.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
from functools import reduce | |
from operator import xor | |
a = [1, 2, 4, 7, 15, 31] | |
s = set([]) | |
for i in range(1, len(a) + 1): | |
for e in combinations(a, i): | |
s.add(sum(e)) | |
l = list(s) + [i for i in range(1, 61)] | |
x = reduce(lambda x, y: xor(x, y), l) | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment