This question already has an answer here:
- A subset of Verbal arithmetic 4 answers
The letters spell out actual words, but if you replace each letter with a digit from 0–9, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “word” can start with the digit 0.
HAWAII + IDAHO + IOWA + OHIO = STATES
510199 + 98153 + 9301 + 3593 = 621246
I + LOVE + YOU = DORA
1 + 2784 + 975 = 3760
SEND + MORE = MONEY
9567 + 1085 = 10652
- Standard loopholes apply.
- shortest code wins.
- addition only
for other Inputs you gotta keep in mind you can only have 10 different characters(to assign values 0-9)