Cody

Problem 44816. Word Distance - Average Sort

Solution 2492828

Submitted on 7 Jun 2020
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   Fail
assert(isequal(word_distance_sort({'jazz','cab','tree'}),{'cab','tree','jazz'}))

Index exceeds the number of array elements (3). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test1 (line 1) assert(isequal(word_distance_sort({'jazz','cab','tree'}),{'cab','tree','jazz'}))

2   Fail
assert(isequal(word_distance_sort({'first','second','third'}),{'first','second','third'}))

Index exceeds the number of array elements (3). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test2 (line 1) assert(isequal(word_distance_sort({'first','second','third'}),{'first','second','third'}))

3   Fail
assert(isequal(word_distance_sort({'the','longest','words','supercede','some','of','the','shortest'}), ... {'some','longest','of','the','the','supercede','shortest','words'}))

Index exceeds the number of array elements (8). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test3 (line 1) assert(isequal(word_distance_sort({'the','longest','words','supercede','some','of','the','shortest'}), ...

4   Fail
assert(isequal(word_distance_sort({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'}), ... {'one','TWO','EiGHt','FouR','NINe','Three','ten','fiVe','six','sEvEn'}))

Index exceeds the number of array elements (10). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test4 (line 1) assert(isequal(word_distance_sort({'one','TWO','Three','FouR','fiVe','six','sEvEn','EiGHt','NINe','ten'}), ...

5   Fail
assert(isequal(word_distance_sort({'Why','is','it','that','this','does','not','work','as','expected'}), ... {'not','work','is','it','this','does','as','expected','that','Why'}))

Index exceeds the number of array elements (10). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test5 (line 1) assert(isequal(word_distance_sort({'Why','is','it','that','this','does','not','work','as','expected'}), ...

6   Fail
assert(isequal(word_distance_sort({'set','of','very','short','words','for','this','test','case'}), ... {'for','of','short','this','test','words','case','very','set'}))

Index exceeds the number of array elements (9). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test6 (line 1) assert(isequal(word_distance_sort({'set','of','very','short','words','for','this','test','case'}), ...

7   Fail
assert(isequal(word_distance_sort({'iron','zinc','carbon','molybdenum','praseodymium','silicon'}), ... {'iron','silicon','molybdenum','carbon','zinc','praseodymium'}))

Index exceeds the number of array elements (6). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test7 (line 1) assert(isequal(word_distance_sort({'iron','zinc','carbon','molybdenum','praseodymium','silicon'}), ...

8   Fail
assert(isequal(word_distance_sort({'crazier','craziest','crazy'}), ... {'crazy','craziest','crazier'}))

Index exceeds the number of array elements (3). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test8 (line 1) assert(isequal(word_distance_sort({'crazier','craziest','crazy'}), ...

9   Fail
assert(isequal(word_distance_sort({'this','test','case','with','only','four','each','word'}), ... {'each','only','four','this','word','test','case','with'}))

Index exceeds the number of array elements (8). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test9 (line 1) assert(isequal(word_distance_sort({'this','test','case','with','only','four','each','word'}), ...

10   Fail
assert(isequal(word_distance_sort({'largest','smallest','sourest','sweetest'}), ... {'sourest','smallest','largest','sweetest'}))

Index exceeds the number of array elements (4). Error in word_distance_sort (line 6) d=str_arr(l); Error in Test10 (line 1) assert(isequal(word_distance_sort({'largest','smallest','sourest','sweetest'}), ...