Created
March 25, 2014 14:48
-
-
Save oantolin/9763333 to your computer and use it in GitHub Desktop.
DONT + TAKE = MONEY
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
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!