forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alphametics.json
37 lines (37 loc) · 1.26 KB
/
alphametics.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"solve": {
"description": "Solve the alphametics puzzle",
"cases": [
{
"description": "solve short puzzle",
"puzzle": "I + BB == ILL",
"expected": { "I": 1, "B": 9, "L": 0 }
},
{
"description": "solve long puzzle",
"puzzle": "SEND + MORE == MONEY",
"expected": { "S": 9, "E": 5, "N": 6, "D": 7, "M": 1, "O": 0, "R": 8, "Y": 2 }
},
{
"description": "solve puzzle with multiplication",
"puzzle": "IF * DR == DORI",
"expected": { "I": 8, "F": 2, "D": 3, "R": 9, "O": 1 }
},
{
"description": "solve puzzle with exponents",
"puzzle": "PI * R ^ 2 == AREA",
"expected": { "P": 9, "I": 6, "R": 7, "A": 4, "E": 0 }
},
{
"description": "solution must have unique value for each letter",
"puzzle": "A == B",
"expected": null
},
{
"description": "leading zero solution is invalid",
"puzzle": "ACA + DD == BD",
"expected": null
}
]
}
}