Task
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.
Input
HAWAII + IDAHO + IOWA + OHIO = STATES
Output
510199 + 98153 + 9301 + 3593 = 621246
Input
I + LOVE + YOU = DORA
Output
1 + 2784 + 975 = 3760
Input
SEND + MORE = MONEY
Output
9567 + 1085 = 10652
Rules
- Standard loopholes apply.
- shortest code wins.
- addition only
Appendix
for other Inputs you gotta keep in mind you can only have 10 different characters(to assign values 0-9)
[[[S,E,N,D],[M,O,R,E]],[M,O,N,E,Y]]
? \$\endgroup\$ – Fatalize Oct 17 '17 at 11:07A-Z
? Can we choose lower case if we want? \$\endgroup\$ – Stewie Griffin Oct 17 '17 at 11:13