problem-specifications
problem-specifications copied to clipboard
book-store: Add test that requires use of both groups of 4 and groups of 5
Many of the "brute force" solutions I see do something like run a greedy solver multiple times with different maximum group sizes. This allows them to solve test cases that check for finding 2 groups of 4 instead of a group of 5 and a group of 3.
However, this wouldn't solve cases where you need to use both groups of 5 and groups of 4. For example, consider books = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3]. The cheapest price possible is achieved by splitting it into 1 group of 5 and 2 groups of 4, with cost = 800*(150.75 + 240.8) = 8120. Solutions like those described above will typically split it into 2 groups of 5 and 1 group of 3, with a cost of 800*(250.75 + 130.9) = 8160.
For further motivation and discussion see: https://github.com/exercism/python/pull/2141
Yeah that's brilliant idea to add test book store that gives in shuffled order
I agree with adding this, but I've tended to consider an omitted test (as opposed to an included test that was manifestly wrong) as blocked by #1560 ... should this one also get a Hold label for the moment? Not that I want to add to the backlog.
@sswingle Are you still interested in working on this PR?