Cody

# Problem 470. Scoring for oriented dominoes

Solution 423132

Submitted on 27 Mar 2014
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 2; 5 4; 2 4]; order = [1 3 2]; y_correct = 1; assert(isequal(scoreOrderedDominoes(list, order),y_correct))

2   Pass
%% list = [1 2; 5 4; 2 4]; order = [2 1 3]; y_correct = 3; assert(isequal(scoreOrderedDominoes(list, order),y_correct))

3   Fail
%% list = [1 2; 5 4; 2 4; 1 6; 7 5; 4 5; 4 8]; order = [2 1 3 7 4 6 5]; y_correct = 14; assert(isequal(scoreOrderedDominoes(list, order),y_correct))

Error: Assertion failed.

4   Pass
%% list = [1 2; 6 6; 2 4]; order = [2 1 3]; y_correct = 5; assert(isequal(scoreOrderedDominoes(list, order),y_correct))

5   Pass
%% list = [1 2; 5 4; 2 4]; order = [1 2 3]; y_correct = 5; assert(isequal(scoreOrderedDominoes(list, order),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
{"ft_lang_label":"__label__en","ft_lang_prob":0.52431774,"math_prob":0.9797159,"size":1045,"snap":"2020-45-2020-50","text_gpt3_token_len":381,"char_repetition_ratio":0.14505284,"word_repetition_ratio":0.27118644,"special_character_ratio":0.39330143,"punctuation_ratio":0.19634703,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9752771,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-28T18:08:19Z\",\"WARC-Record-ID\":\"<urn:uuid:d0f0af5b-caa0-48cd-bbc6-ae6fa3cb4c38>\",\"Content-Length\":\"82819\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:91f966d0-4eaa-46b7-9d48-c58f339a112f>\",\"WARC-Concurrent-To\":\"<urn:uuid:d64daffc-8dd2-48a9-a72c-d0cc874563d5>\",\"WARC-IP-Address\":\"23.223.252.57\",\"WARC-Target-URI\":\"https://la.mathworks.com/matlabcentral/cody/problems/470-scoring-for-oriented-dominoes/solutions/423132\",\"WARC-Payload-Digest\":\"sha1:TWFTHJ5MQLLBMH5WSIALFLVGVYSDTHMZ\",\"WARC-Block-Digest\":\"sha1:HDNENT5OKACNZ4VNZ3KBCEQY7I6ZK7KL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107900200.97_warc_CC-MAIN-20201028162226-20201028192226-00001.warc.gz\"}"}