Cody

# Problem 520. Choose the best fitting dominoes

Solution 1840824

Submitted on 6 Jun 2019 by Hans Kramer
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
list = {[1 5; 2 3; 2 2; 3 4; 0 3], [0 4; 1 5; 2 2; 4 5; 4 6], [7 7; 3 8; 4 7; 5 9; 0 4]}; selections = [4 4 4]; assert(isequal(ChooseBestFittingDominoes(list),selections))

minsum = 1000000 a = 1 5 b = 0 4 c = 7 7 sum = 8 minsum = 8 order = 1 1 1 c = 3 8 sum = 6 minsum = 6 order = 1 1 2 c = 4 7 sum = 5 minsum = 5 order = 1 1 3 c = 5 9 sum = 6 c = 0 4 sum = 9 b = 1 5 c = 7 7 sum = 6 c = 3 8 sum = 6 c = 4 7 sum = 5 c = 5 9 sum = 4 minsum = 4 order = 1 2 4 c = 0 4 sum = 9 b = 2 2 c = 7 7 sum = 8 c = 3 8 sum = 4 c = 4 7 sum = 5 c = 5 9 sum = 6 c = 0 4 sum = 5 b = 4 5 c = 7 7 sum = 3 minsum = 3 order = 1 4 1 c = 3 8 sum = 3 c = 4 7 sum = 2 minsum = 2 order = 1 4 3 c = 5 9 sum = 1 minsum = 1 order = 1 4 4 c = 0 4 sum = 6 b = 4 6 c = 7 7 sum = 2 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7 a = 2 3 b = 0 4 c = 7 7 sum = 6 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 4 c = 0 4 sum = 7 b = 1 5 c = 7 7 sum = 4 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7 b = 2 2 c = 7 7 sum = 6 c = 3 8 sum = 2 c = 4 7 sum = 3 c = 5 9 sum = 4 c = 0 4 sum = 3 b = 4 5 c = 7 7 sum = 3 c = 3 8 sum = 3 c = 4 7 sum = 2 c = 5 9 sum = 1 c = 0 4 sum = 6 b = 4 6 c = 7 7 sum = 2 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7 a = 2 2 b = 0 4 c = 7 7 sum = 5 c = 3 8 sum = 3 c = 4 7 sum = 2 c = 5 9 sum = 3 c = 0 4 sum = 6 b = 1 5 c = 7 7 sum = 3 c = 3 8 sum = 3 c = 4 7 sum = 2 c = 5 9 sum = 1 c = 0 4 sum = 6 b = 2 2 c = 7 7 sum = 5 c = 3 8 sum = 1 c = 4 7 sum = 2 c = 5 9 sum = 3 c = 0 4 sum = 2 b = 4 5 c = 7 7 sum = 4 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7 b = 4 6 c = 7 7 sum = 3 c = 3 8 sum = 5 c = 4 7 sum = 4 c = 5 9 sum = 3 c = 0 4 sum = 8 a = 3 4 b = 0 4 c = 7 7 sum = 7 c = 3 8 sum = 5 c = 4 7 sum = 4 c = 5 9 sum = 5 c = 0 4 sum = 8 b = 1 5 c = 7 7 sum = 5 c = 3 8 sum = 5 c = 4 7 sum = 4 c = 5 9 sum = 3 c = 0 4 sum = 8 b = 2 2 c = 7 7 sum = 7 c = 3 8 sum = 3 c = 4 7 sum = 4 c = 5 9 sum = 5 c = 0 4 sum = 4 b = 4 5 c = 7 7 sum = 2 c = 3 8 sum = 2 c = 4 7 sum = 1 c = 5 9 sum = 0 minsum = 0 order = 4 4 4 c = 0 4 sum = 5 b = 4 6 c = 7 7 sum = 1 c = 3 8 sum = 3 c = 4 7 sum = 2 c = 5 9 sum = 1 c = 0 4 sum = 6 a = 0 3 b = 0 4 c = 7 7 sum = 6 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 4 c = 0 4 sum = 7 b = 1 5 c = 7 7 sum = 4 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7 b = 2 2 c = 7 7 sum = 6 c = 3 8 sum = 2 c = 4 7 sum = 3 c = 5 9 sum = 4 c = 0 4 sum = 3 b = 4 5 c = 7 7 sum = 3 c = 3 8 sum = 3 c = 4 7 sum = 2 c = 5 9 sum = 1 c = 0 4 sum = 6 b = 4 6 c = 7 7 sum = 2 c = 3 8 sum = 4 c = 4 7 sum = 3 c = 5 9 sum = 2 c = 0 4 sum = 7

2   Pass
list = {[1 4; 2 2; 1 1; 3 3],[1 2; 2 3],[2 2]}; selections = [3 1 1]; assert(isequal(ChooseBestFittingDominoes(list),selections))

minsum = 1000000 a = 1 4 b = 1 2 c = 2 2 sum = 3 minsum = 3 order = 1 1 1 b = 2 3 c = 2 2 sum = 3 a = 2 2 b = 1 2 c = 2 2 sum = 1 minsum = 1 order = 2 1 1 b = 2 3 c = 2 2 sum = 1 a = 1 1 b = 1 2 c = 2 2 sum = 0 minsum = 0 order = 3 1 1 b = 2 3 c = 2 2 sum = 2 a = 3 3 b = 1 2 c = 2 2 sum = 2 b = 2 3 c = 2 2 sum = 2