Created
December 25, 2020 16:32
-
-
Save md2perpe/2df57959c323aa85e83ef0f7f2d41e14 to your computer and use it in GitHub Desktop.
Solve a specific character addition
This file contains hidden or 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
# Solve: | |
# LETA | |
# +TALL | |
# ===== | |
# CACHE | |
for a in range(10): | |
for e in range(10): | |
for l in range(10): | |
for t in range(10): | |
for c in range(10): | |
for h in range(10): | |
if int(f"{l}{e}{t}{a}") + int(f"{t}{a}{l}{l}") == int(f"{c}{a}{c}{h}{e}"): | |
print(f"{l}{e}{t}{a} + {t}{a}{l}{l} = {c}{a}{c}{h}{e}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Removing solutions where the first character in some number is 0 we only have these solutions:
If we also remove solutions where several letters stand for the same digit, we only have one solution left: