Skip to content

Instantly share code, notes, and snippets.

@vexorian
Created May 20, 2015 06:25
Show Gist options
  • Save vexorian/a8c480cd12f52d73c71b to your computer and use it in GitHub Desktop.
Save vexorian/a8c480cd12f52d73c71b to your computer and use it in GitHub Desktop.
Problem 5
def five():
for x in range(3**8):
nums = []
s = '1'
for i in xrange(2,10):
d = x / (3**(i - 2)) % 3
if d == 0:
s = s + str(i)
elif d == 1:
s = s + '+' + str(i)
else:
s = s + '-' + str(i)
if eval(s) == 100:
print s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment