{ "book-store": { "description": [ "Calculate lowest price for shopping basket only ", "containing books from a single series. There is no ", "discount advantage for having more than one copy of ", "any single book in a grouping." ], "cases": [ { "description": "A basket containing only a single book.", "basket": [1], "targetgrouping": [[1]], "expected": 8.0 }, { "description": "A basket containing only two of the same book.", "basket": [2, 2], "targetgrouping": [[2], [2]], "expected": 16.0 }, { "description": "No charge to carry around an empty basket.", "basket": [], "targetgrouping": [], "expected": 0.0 }, { "description": "A basket containing only two different books.", "basket": [1, 2], "targetgrouping": [[1, 2]], "expected": 15.2 }, { "description": "A basket of three different books.", "basket": [1, 2, 3], "targetgrouping": [[1, 2, 3]], "expected": 21.60 }, { "description": "A basket of four different books.", "basket": [1, 2, 3, 4], "targetgrouping": [[1, 2, 3, 4]], "expected": 25.60 }, { "description": "A basket of five different books.", "basket": [1, 2, 3, 4, 5], "targetgrouping": [[1, 2, 3, 4, 5]], "expected": 30.00 }, { "description": [ "A basket containing eight books consisting of a ", "pair each of the first three books plus one copy ", "each of the last two books. Please pay careful ", "attention to this particular target grouping, it ", "is not intuitive, but does grant the largest ", "discount." ], "basket": [1, 1, 2, 2, 3, 3, 4, 5], "targetgrouping": [[1, 2, 3, 4], [1, 2, 3, 5]], "expected": 51.20 }, { "description": [ "A basket containing nine books consisting of a ", "pair each of the first four books plus one of ", "the last book." ], "basket": [1, 1, 2, 2, 3, 3, 4, 4, 5], "targetgrouping": [[1, 2, 3, 4, 5], [1, 2, 3, 4]], "expected": 55.60 }, { "description": [ "A basket containing ten books consisting of two ", "copies of each book in the series." ], "basket": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5], "targetgrouping": [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5]], "expected": 60.00 }, { "description": [ "A basket containing eleven books consisting ", "of three copies of the first book plus two each ", "of the remaining four books in the series." ], "basket": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1], "targetgrouping": [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1]], "expected": 68.00 }, { "description": [ "A basket containing twelve books consisting of ", "three copies of the first two books, plus two ", "each of the remaining three books in the series." ], "basket": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2], "targetgrouping": [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2]], "expected": 75.20 } ] } }