Cody

Solution 472372

Submitted on 14 Jul 2014 by Abdullah Caliskan
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 3; 2 4; 5 6],[4 6; 2 5;6 7],[3 4; 6 1; 4 6]} selections = [2 1 2]; assert(isequal(ChooseBestFittingDominoes(list),selections))

list = [3x2 double] [3x2 double] [3x2 double] L1 = 1 3 2 4 5 6 L2 = 4 6 2 5 6 7 L3 = 3 4 6 1 4 6 KK = 1 3 4 6 3 4 KK = 1 3 4 6 6 1 KK = 1 3 4 6 4 6 KK = 1 3 2 5 3 4 KK = 1 3 2 5 6 1 KK = 1 3 2 5 4 6 KK = 1 3 6 7 3 4 KK = 1 3 6 7 6 1 KK = 1 3 6 7 4 6 KK = 2 4 4 6 3 4 KK = 2 4 4 6 6 1 N = 2 1 2 KK = 2 4 4 6 4 6 KK = 2 4 2 5 3 4 KK = 2 4 2 5 6 1 KK = 2 4 2 5 4 6 KK = 2 4 6 7 3 4 KK = 2 4 6 7 6 1 KK = 2 4 6 7 4 6 KK = 5 6 4 6 3 4 KK = 5 6 4 6 6 1 KK = 5 6 4 6 4 6 KK = 5 6 2 5 3 4 KK = 5 6 2 5 6 1 KK = 5 6 2 5 4 6 KK = 5 6 6 7 3 4 KK = 5 6 6 7 6 1 KK = 5 6 6 7 4 6

2   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))

L1 = 1 5 2 3 2 2 3 4 0 3 L2 = 0 4 1 5 2 2 4 5 4 6 L3 = 7 7 3 8 4 7 5 9 0 4 KK = 1 5 0 4 7 7 KK = 1 5 0 4 3 8 KK = 1 5 0 4 4 7 KK = 1 5 0 4 5 9 KK = 1 5 0 4 0 4 KK = 1 5 1 5 7 7 KK = 1 5 1 5 3 8 KK = 1 5 1 5 4 7 K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K = 2 2 4 6 4 7 KK = 2 2 4 6 5 9 KK = 2 2 4 6 0 4 KK = 3 4 0 4 7 7 KK = 3 4 0 4 3 8 KK = 3 4 0 4 4 7 KK = 3 4 0 4 5 9 KK = 3 4 0 4 0 4 KK = 3 4 1 5 7 7 KK = 3 4 1 5 3 8 KK = 3 4 1 5 4 7 KK = 3 4 1 5 5 9 KK = 3 4 1 5 0 4 KK = 3 4 2 2 7 7 KK = 3 4 2 2 3 8 KK = 3 4 2 2 4 7 KK = 3 4 2 2 5 9 KK = 3 4 2 2 0 4 KK = 3 4 4 5 7 7 KK = 3 4 4 5 3 8 KK = 3 4 4 5 4 7 KK = 3 4 4 5 5 9 N = 4 4 4 KK = 3 4 4 5 0 4 KK = 3 4 4 6 7 7 KK = 3 4 4 6 3 8 KK = 3 4 4 6 4 7 KK = 3 4 4 6 5 9 KK = 3 4 4 6 0 4 KK = 0 3 0 4 7 7 KK = 0 3 0 4 3 8 KK = 0 3 0 4 4 7 KK = 0 3 0 4 5 9 KK = 0 3 0 4 0 4 KK = 0 3 1 5 7 7 KK = 0 3 1 5 3 8 KK = 0 3 1 5 4 7 KK = 0 3 1 5 5 9 KK = 0 3 1 5 0 4 KK = 0 3 2 2 7 7 KK = 0 3 2 2 3 8 KK = 0 3 2 2 4 7 KK = 0 3 2 2 5 9 KK = 0 3 2 2 0 4 KK = 0 3 4 5 7 7 KK = 0 3 4 5 3 8 KK = 0 3 4 5 4 7 KK = 0 3 4 5 5 9 KK = 0 3 4 5 0 4 KK = 0 3 4 6 7 7 KK = 0 3 4 6 3 8 KK = 0 3 4 6 4 7 KK = 0 3 4 6 5 9 KK = 0 3 4 6 0 4

3   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))

L1 = 1 4 2 2 1 1 3 3 L2 = 1 2 2 3 L3 = 2 2 KK = 1 4 1 2 2 2 KK = 1 4 2 3 2 2 KK = 2 2 1 2 2 2 KK = 2 2 2 3 2 2 KK = 1 1 1 2 2 2 N = 3 1 1 KK = 1 1 2 3 2 2 KK = 3 3 1 2 2 2 KK = 3 3 2 3 2 2