Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ds = set(range(2,10))
for t in ds:
e = 11-t
for n in ds - {t,e}:
for x in [0,1]:
k = 10*x+e-n-1
if k in ds - {t,e,n}:
for o in ds - {t,e,n,k}:
for y in [0,1]:
a = 10*y+n-o-x
if a+t+y==10+o and a in ds - {t,e,n,k,o}:
print "%s%s%s%s + %s%s%s%s = 1%s%s%s1" % (a,o,n,t,t,a,k,e,o,n,e)

This comment has been minimized.

Copy link

@djsell djsell commented Mar 25, 2014

Ah. I like your solution. It is much cleaner :)

I did mine in a way that was more generalized in case we see another one of these problems.

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment