Cody

Solution 239471

Submitted on 3 May 2013 by Clemens Giegerich
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
clear clc

2   Pass
%% list = [ 1 5 2 1 2 2 3 2 4 8 5 4 5 5 10 3]; correct = [8 4 3 2 1 7 6 5]; assert(isequal(findPerfectOrderedDominoes(list),correct))

score = 7 score = 11 score = 9 score = 10 score = 12 score = 11 score = 9 score = 13 score = 11 score = 10 score = 14 score = 11 score = 11 score = 12 score = 11 score = 14 score = 10 score = 12 score = 14 score = 13 score = 14 score = 14 score = 12 score = 11 score = 11 score = 15 score = 13 score = 14 score = 16 score = 15 score = 11 score = 15 score = 13 score = 4 score = 10 score = 11 score = 13 score = 6 score = 13 score = 16 score = 10 score = 8 score = 10 score = 15 score = 10 score = 16 score = 12 score = 11 score = 13 score = 17 score = 15 score = 6 score = 12 score = 13 score = 11 score = 15 score = 15 score = 14 score = 18 score = 15 score = 13 score = 16 score = 15 score = 8 score = 8 score = 10 score = 14 score = 11 score = 16 score = 12 score = 10 score = 15 score = 15 score = 8 score = 15 score = 18 score = 14 score = 12 score = 15 score = 8 score = 13 score = 16 score = 12 score = 10 score = 15 score = 16 score = 13 score = 16 score = 16 score = 18 score = 14 score = 10 score = 12 score = 10 score = 14 score = 8 score = 10 score = 15 score = 10 score = 16 score = 16 score = 15 score = 12 score = 17 score = 12 score = 16 score = 18 score = 15 score = 12 score = 16 score = 12 score = 18 score = 16 score = 18 score = 14 score = 13 score = 14 score = 14 score = 12 score = 11 score = 7 score = 11 score = 9 score = 10 score = 12 score = 11 score = 9 score = 13 score = 11 score = 10 score = 14 score = 11 score = 11 score = 12 score = 11 score = 14 score = 10 score = 12 score = 14 score = 13 score = 14 score = 14 score = 12 score = 11 score = 13 score = 17 score = 15 score = 16 score = 18 score = 17 score = 13 score = 17 score = 15 score = 8 score = 16 score = 11 score = 15 score = 10 score = 15 score = 18 score = 10 score = 14 score = 16 score = 17 score = 16 score = 18 score = 12 score = 11 score = 15 score = 19 score = 17 score = 10 score = 18 score = 13 score = 13 score = 17 score = 17 score = 16 score = 20 score = 17 score = 15 score = 18 score = 17 score = 12 score = 14 score = 10 score = 14 score = 11 score = 18 score = 18 score = 16 score = 17 score = 17 score = 12 score = 17 score = 20 score = 14 score = 18 score = 17 score = 12 score = 15 score = 18 score = 12 score = 16 score = 17 score = 18 score = 15 score = 18 score = 18 score = 20 score = 16 score = 16 score = 12 score = 10 score = 16 score = 14 score = 16 score = 17 score = 16 score = 18 score = 18 score = 17 score = 18 score = 19 score = 18 score = 18 score = 20 score = 17 score = 18 score = 18 score = 18 score = 20 score = 18 score = 20 score = 14 score = 13 score = 14 score = 14 score = 12 score = 11 score = 11 score = 15 score = 13 score = 14 score = 16 score = 15 score = 17 score = 21 score = 19 score = 12 score = 20 score = 15 score = 19 score = 14 score = 19 score = 22 score = 14 score = 18 score = 20 score = 21 score = 20 score = 22 score = 16 score = 15 score = 13 score = 17 score = 15 score = 16 score = 18 score = 17 score = 17 score = 21 score = 19 score = 10 score = 16 score = 17 score = 19 score = 12 score = 19 score = 22 score = 16 score = 14 score = 16 score = 21 score = 16 score = 22 score = 18 score = 17 score = 13 score = 17 score = 19 score = 10 score = 16 score = 17 score = 11 score = 15 score = 19 score = 12 score = 20 score = 15 score = 13 score = 14 score = 15 score = 12 score = 4 score = 8 score = 16 score = 11 score = 14 score = 12 score = 10 score = 11 score = 19 score = 12 score = 15 score = 18 score = 18 score = 16 score = 15 score = 12 score = 13 score = 14 score = 10 score = 6 score = 19 score = 14 score = 13 score = 16 score = 16 score = 20 score = 12 score = 10 score = 14 score = 10 score = 10 score = 8 score = 10 score = 15 score = 10 score = 16 score = 12 score = 11 score = 16 score = 17 score = 12 score = 14 score = 20 score = 15 score = 12 score = 14 score = 16 score = 18 score = 16 score = 20 score = 16 score = 17 score = 16 score = 18 score = 12 score = 11 score = 17 score = 21 score = 19 score = 12 score = 20 score = 15 score = 11 score = 15 score = 15 score = 14 score = 18 score = 15 score = 19 score = 22 score = 21 score = 16 score = 18 score = 14 score = 18 score = 15 score = 22 score = 22 score = 20 score = 21 score = 13 score = 17 score = 21 score = 14 score = 22 score = 17 score = 15 score = 19 score = 21 score = 12 score = 18 score = 19 score = 17 score = 14 score = 15 score = 16 score = 10 score = 6 score = 12 score = 13 score = 14 score = 16 score = 18 score = 13 score = 17 score = 21 score = 19 score = 10 score = 16 score = 17 score = 13 score = 17 score = 17 score = 16 score = 20 score = 17 score = 19 score = 22 score = 21 score = 14 score = 14 score = 16 score = 20 score = 17 score = 22 score = 18 score = 16 score = 21 score = 17 score = 14 score = 15 score = 16 score = 12 score = 8 score = 19 score = 12 score = 15 score = 18 score = 18 score = 16 score = 13 score = 16 score = 19 score = 14 score = 20 score = 16 score = 10 score = 8 score = 10 score = 14 score = 12 score = 10 score = 16 score = 17 score = 12 score = 14 score = 20 score = 15 score = 10 score = 15 score = 12 score = 16 score = 14 score = 11 score = 16 score = 18 score = 14 score = 16 score = 20 score = 16 score = 14 score = 11 score = 18 score = 18 score = 16 score = 17 score = 19 score = 14 score = 19 score = 22 score = 16 score = 20 score = 21 score = 16 score = 19 score = 22 score = 16 score = 20 score = 15 score = 16 score = 13 score = 16 score = 16 score = 18 score = 22 score = 22 score = 18 score = 16 score = 22 score = 20 score = 21 score = 16 score = 15 score = 18 score = 18 score = 22 score = 15 score = 16 score = 17 score = 14 score = 8 score = 12 score = 21 score = 14 score = 17 score = 20 score = 20 score = 18 score = 14 score = 16 score = 12 score = 14 score = 14 score = 18 score = 15 score = 16 score = 17 score = 14 score = 8 score = 12 score = 19 score = 14 score = 13 score = 16 score = 16 score = 20 score = 15 score = 18 score = 19 score = 12 score = 16 score = 18 score = 12 score = 16 score = 12 score = 10 score = 12 score = 14 score = 19 score = 12 score = 19 score = 22 score = 18 score = 16 score = 21 score = 14 score = 19 score = 22 score = 18 score = 16 score = 17 score = 18 score = 15 score = 18 score = 18 score = 20 score = 22 score = 18 score = 20 score = 18 score = 22 score = 16 score = 10 score = 12 score = 14 score = 16 score = 14 score = 18 score = 12 score = 14 score = 14 score = 16 score = 14 score = 18 score = 10 score = 14 score = 8 score = 14 score = 10 score = 12 score = 16 score = 16 score = 12 score = 10 score = 16 score = 14 score = 16 score = 17 score = 16 score = 18 score = 18 score = 17 score = 18 score = 19 score = 18 score = 18 score = 20 score = 17 score = 18 score = 18 score = 18 score = 20 score = 18 score = 20 score = 14 score = 13 score = 14 score = 14 score = 12 score = 11 score = 20 score = 21 score = 20 score = 22 score = 16 score = 15 score = 20 score = 15 score = 14 score = 12 score = 16 score = 17 score = 14 score = 12 score = 20 score = 16 score = 18 score = 16 score = 16 score = 21 score = 16 score = 22 score = 18 score = 17 score = 22 score = 17 score = 16 score = 14 score = 18 score = 19 score = 20 score = 21 score = 22 score = 22 score = 18 score = 15 score = 20 score = 16 score = 16 score = 14 score = 16 score = 18 score = ...

3   Fail
%% list = [ 1 6 2 2 2 7 7 1 7 8 8 10 10 2 10 10]; correct = [5 6 8 7 2 3 4 1]; assert(isequal(findPerfectOrderedDominoes(list),correct))

score = 17 score = 21 score = 17 score = 16 score = 14 score = 19 score = 17 score = 19 score = 25 score = 22 score = 30 score = 23 score = 15 score = 22 score = 27 score = 24 score = 18 score = 20 score = 30 score = 21 score = 20 score = 26 score = 18 score = 23 score = 27 score = 31 score = 27 score = 26 score = 26 score = 31 score = 17 score = 21 score = 27 score = 17 score = 25 score = 23 score = 17 score = 17 score = 27 score = 26 score = 18 score = 15 score = 23 score = 19 score = 13 score = 24 score = 16 score = 21 score = 27 score = 31 score = 27 score = 17 score = 23 score = 21 score = 17 score = 19 score = 25 score = 22 score = 30 score = 23 score = 25 score = 32 score = 37 score = 25 score = 27 score = 22 score = 32 score = 23 score = 30 score = 35 score = 27 score = 33 score = 27 score = 27 score = 37 score = 36 score = 26 score = 23 score = 27 score = 15 score = 15 score = 22 score = 22 score = 27 score = 25 score = 32 score = 27 score = 24 score = 28 score = 30 score = 20 score = 25 score = 22 score = 18 score = 28 score = 17 score = 27 score = 23 score = 17 score = 28 score = 28 score = 33 score = 25 score = 31 score = 35 score = 30 score = 30 score = 21 score = 25 score = 20 score = 25 score = 36 score = 26 score = 30 score = 32 score = 23 score = 22 score = 28 score = 18 score = 23 score = 15 score = 19 score = 15 score = 14 score = 12 score = 17 score = 15 score = 17 score = 23 score = 20 score = 28 score = 21 score = 13 score = 20 score = 25 score = 22 score = 16 score = 18 score = 28 score = 19 score = 18 score = 24 score = 16 score = 21 score = 27 score = 31 score = 27 score = 26 score = 26 score = 31 score = 17 score = 21 score = 27 score = 15 score = 23 score = 23 score = 17 score = 15 score = 27 score = 26 score = 18 score = 13 score = 21 score = 19 score = 11 score = 24 score = 16 score = 21 score = 27 score = 31 score = 27 score = 15 score = 21 score = 21 score = 17 score = 19 score = 25 score = 22 score = 30 score = 23 score = 25 score = 32 score = 37 score = 23 score = 25 score = 22 score = 32 score = 23 score = 30 score = 33 score = 25 score = 33 score = 27 score = 25 score = 37 score = 36 score = 26 score = 21 score = 27 score = 13 score = 15 score = 22 score = 22 score = 25 score = 25 score = 32 score = 27 score = 24 score = 28 score = 30 score = 20 score = 23 score = 22 score = 18 score = 28 score = 15 score = 25 score = 23 score = 15 score = 28 score = 28 score = 33 score = 23 score = 31 score = 33 score = 30 score = 30 score = 21 score = 23 score = 20 score = 23 score = 36 score = 26 score = 30 score = 32 score = 23 score = 22 score = 28 score = 18 score = 23 score = 25 score = 29 score = 25 score = 24 score = 24 score = 29 score = 27 score = 31 score = 37 score = 25 score = 33 score = 33 score = 27 score = 25 score = 37 score = 36 score = 28 score = 23 score = 33 score = 31 score = 23 score = 36 score = 28 score = 33 score = 27 score = 31 score = 27 score = 26 score = 26 score = 31 score = 27 score = 31 score = 37 score = 27 score = 35 score = 33 score = 27 score = 27 score = 37 score = 36 score = 28 score = 25 score = 35 score = 31 score = 25 score = 36 score = 28 score = 33 score = 17 score = 21 score = 27 score = 17 score = 25 score = 23 score = 15 score = 19 score = 27 score = 15 score = 23 score = 23 score = 25 score = 25 score = 27 score = 27 score = 17 score = 13 score = 25 score = 21 score = 21 score = 25 score = 27 score = 23 score = 27 score = 27 score = 27 score = 26 score = 28 score = 25 score = 17 score = 17 score = 15 score = 15 score = 13 score = 17 score = 27 score = 25 score = 25 score = 24 score = 28 score = 23 score = 11 score = 15 score = 15 score = 16 score = 18 score = 17 score = 25 score = 21 score = 15 score = 26 score = 16 score = 21 score = 23 score = 19 score = 23 score = 19 score = 21 score = 17 score = 13 score = 9 score = 23 score = 24 score = 22 score = 21 score = 23 score = 21 score = 13 score = 26 score = 14 score = 19 score = 17 score = 21 score = 17 score = 5 score = 11 score = 11 score = 5 score = 7 score = 13 score = 10 score = 18 score = 11 score = 15 score = 22 score = 27 score = 13 score = 15 score = 12 score = 22 score = 13 score = 20 score = 23 score = 15 score = 23 score = 15 score = 19 score = 27 score = 15 score = 23 score = 23 score = 17 score = 21 score = 27 score = 17 score = 25 score = 23 score = 17 score = 17 score = 15 score = 15 score = 3 score = 7 score = 15 score = 11 score = 13 score = 9 score = 13 score = 9 score = 17 score = 21 score = 17 score = 7 score = 13 score = 11 score = 7 score = 9 score = 15 score = 12 score = 20 score = 13 score = 15 score = 22 score = 27 score = 15 score = 17 score = 12 score = 22 score = 13 score = 20 score = 25 score = 17 score = 23 score = 27 score = 27 score = 25 score = 25 score = 11 score = 15 score = 27 score = 15 score = 15 score = 22 score = 22 score = 27 score = 13 score = 20 score = 27 score = 13 score = 25 score = 22 score = 12 score = 17 score = 10 score = 15 score = 13 score = 17 score = 27 score = 23 score = 17 score = 13 score = 25 score = 21 score = 17 score = 23 score = 27 score = 22 score = 22 score = 13 score = 25 score = 20 score = 25 score = 21 score = 23 score = 18 score = 20 score = 11 score = 22 score = 25 score = 15 score = 23 score = 17 score = 15 score = 27 score = 26 score = 16 score = 11 score = 27 score = 13 score = 15 score = 22 score = 22 score = 25 score = 13 score = 20 score = 15 score = 12 score = 16 score = 18 score = 20 score = 23 score = 22 score = 18 score = 28 score = 15 score = 27 score = 25 score = 25 score = 24 score = 28 score = 23 score = 15 score = 15 score = 17 score = 17 score = 17 score = 13 score = 27 score = 27 score = 27 score = 26 score = 28 score = 25 score = 13 score =