forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
change.json
59 lines (59 loc) · 1.91 KB
/
change.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
"find_fewest_coins": {
"description": [
"Given an infinite supply of coins with different values, ",
"find the smallest number of coins needed to make a desired ",
"amount of change."
],
"cases": [
{
"description": "single coin change",
"coins": [1, 5, 10, 25, 100],
"target": 25,
"expected": [25]
},
{
"description": "multiple coin change",
"coins": [1, 5, 10, 25, 100],
"target": 15,
"expected": [5, 10]
},
{
"description": "change with Lilliputian Coins",
"coins": [1, 4, 15, 20, 50],
"target": 23,
"expected": [4, 4, 15]
},
{
"description": "change with Lower Elbonia Coins",
"coins": [1, 5, 10, 21, 25],
"target": 63,
"expected": [21, 21, 21]
},
{
"description": "large target values",
"coins": [1, 2, 5, 10, 20, 50, 100],
"target": 999,
"expected": [2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100]
},
{
"description": "no coins make 0 change",
"coins": [1, 5, 10, 21, 25],
"target": 0,
"expected": []
},
{
"description": "error testing for change smaller than the smallest of coins",
"coins": [5, 10],
"target": 3,
"expected": -1
},
{
"description": "cannot find negative change values",
"coins": [1, 2, 5],
"target": -5,
"expected": -1
}
]
}
}