Cody

Problem 44816. Word Distance - Average Sort

Solution 2492852

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   Pass
assert(isequal(word_distance_sort({'jazz','cab','tree'}),{'cab','tree','jazz'}))

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

Assertion failed.

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

Assertion failed.

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'}))

Assertion failed.

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'}))

Assertion failed.

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'}))

Assertion failed.

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

Assertion failed.

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

Assertion failed.

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

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

Suggested Problems

More from this Author139