|
1 | 1 | {
|
2 | 2 | "exercise": "book-store",
|
3 |
| - "version": "1.0.1", |
| 3 | + "version": "1.1.0", |
4 | 4 | "cases": [
|
5 | 5 | {
|
6 | 6 | "description": "Return the total basket price after applying the best discount.",
|
7 | 7 | "comments": [
|
8 | 8 | "Calculate lowest price for a shopping basket containing books only from ",
|
9 | 9 | "a single series. There is no discount advantage for having more than ",
|
10 |
| - "one copy of any single book in a grouping." |
| 10 | + "one copy of any single book in a grouping." |
11 | 11 | ],
|
12 | 12 | "cases": [
|
13 | 13 | {
|
|
100 | 100 | "basket": [1,1,2,2,3,3,4,4,5,5,1,2],
|
101 | 101 | "targetgrouping": [[1,2,3,4,5],[1,2,3,4,5],[1,2]],
|
102 | 102 | "expected": 75.20
|
| 103 | + }, |
| 104 | + { |
| 105 | + "property": "total", |
| 106 | + "description": "Four groups of four are cheaper than two groups each of five and three", |
| 107 | + "basket": [1,1,2,2,3,3,4,5,1,1,2,2,3,3,4,5], |
| 108 | + "targetgrouping": [[1,2,3,4],[1,2,3,5],[1,2,3,4],[1,2,3,5]], |
| 109 | + "expected": 102.4 |
103 | 110 | }
|
104 | 111 | ]
|
105 | 112 | }
|
|
0 commit comments