Skip to content

Instantly share code, notes, and snippets.

@oantolin
Created March 25, 2014 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oantolin/9763333 to your computer and use it in GitHub Desktop.
Save oantolin/9763333 to your computer and use it in GitHub Desktop.
DONT + TAKE = MONEY
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)
@djsell
Copy link

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.
https://gist.github.com/djsell/23989126cbae8980ac58

Thanks for sharing!

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