Cody

# Problem 44816. Word Distance - Average Sort

Solution 1705552

Submitted on 10 Jan 2019 by Binbin Qi
• Size: 34
• This is the leading solution.
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   Pass
assert(isequal(word_distance_sort({'first','second','third'}),{'first','second','third'}))

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

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

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

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

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

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

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