Skip to content

Instantly share code, notes, and snippets.

@jo32
Created June 6, 2014 17:42
Show Gist options
  • Save jo32/64e708e75a1623167e74 to your computer and use it in GitHub Desktop.
Save jo32/64e708e75a1623167e74 to your computer and use it in GitHub Desktop.
azran_legacy_puzzle_025.py
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