Cody

Solution 183667

Submitted on 31 Dec 2012
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   Fail
%% 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))
Error: Error: File: findPerfectOrderedDominoes.m Line: 3 Column: 20 The construct "order(...end...)" is ambiguous in this context, because "order" cannot be ascertained to be either the name of a variable or of a function. To make it a variable, assign to it; to allow it to become a function at execution time, replace "end" with a call to LENGTH, SIZE, or NUMEL on the desired array.
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))
Error: Error: File: findPerfectOrderedDominoes.m Line: 3 Column: 20 The construct "order(...end...)" is ambiguous in this context, because "order" cannot be ascertained to be either the name of a variable or of a function. To make it a variable, assign to it; to allow it to become a function at execution time, replace "end" with a call to LENGTH, SIZE, or NUMEL on the desired array.
4   Fail
%% list = [1 1 1 7 2 4 4 6 5 1 6 2 7 4 7 5]; correct = [8 5 1 2 7 4 6 3]; assert(isequal(findPerfectOrderedDominoes(list),correct))
Error: Error: File: findPerfectOrderedDominoes.m Line: 3 Column: 20 The construct "order(...end...)" is ambiguous in this context, because "order" cannot be ascertained to be either the name of a variable or of a function. To make it a variable, assign to it; to allow it to become a function at execution time, replace "end" with a call to LENGTH, SIZE, or NUMEL on the desired array.
5   Fail
%% list = [1 10 3 10 5 3 6 9 7 6 8 7 8 8 9 1 10 5]; correct = [7 6 5 4 8 1 9 3 2]; assert(isequal(findPerfectOrderedDominoes(list),correct))
Error: Error: File: findPerfectOrderedDominoes.m Line: 3 Column: 20 The construct "order(...end...)" is ambiguous in this context, because "order" cannot be ascertained to be either the name of a variable or of a function. To make it a variable, assign to it; to allow it to become a function at execution time, replace "end" with a call to LENGTH, SIZE, or NUMEL on the desired array.