Cody

Solution 2214808

Submitted on 16 Apr 2020 by William
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
ary={ 'CORD', 'CARD', 'DART', 'FORT', 'WARM', 'FARM', 'WARD'} st='COLD' des='WARM' y_correct = {'CORD','CARD','WARD','WARM'}; assert(isequal(word_lad_2(ary,st,des),y_correct))

ary = 1×7 cell array {'CORD'} {'CARD'} {'DART'} {'FORT'} {'WARM'} {'FARM'} {'WARD'} st = 'COLD' des = 'WARM'

2   Pass
ary={'pan','can','fan','pat','mat','fat','lot','opt','apt','act','ape','put','aut'} st='man' des='ape' y_correct = {'pan' 'pat' 'put' 'aut' 'apt' 'ape'}; assert(isequal(word_lad_2(ary,st,des),y_correct))

ary = 1×13 cell array {'pan'} {'can'} {'fan'} {'pat'} {'mat'} {'fat'} {'lot'} {'opt'} {'apt'} {'act'} {'ape'} {'put'} {'aut'} st = 'man' des = 'ape'

3   Pass
ary={'leg','hot','dot','dog','lot','log','cog','hog','zog','fog'} st='hit' des='fog' y_correct = {'hot','hog','fog'}; assert(isequal(word_lad_2(ary,st,des),y_correct))

ary = 1×10 cell array {'leg'} {'hot'} {'dot'} {'dog'} {'lot'} {'log'} {'cog'} {'hog'} {'zog'} {'fog'} st = 'hit' des = 'fog'

4   Pass
ary={'safer', 'rifer','upper','rifre', 'rider','tider' ,'cider','coder','loder', 'cooer', 'cooey', 'gooey', 'goosy' , 'goose' ,'loose','nosey','doose'} st='refer' des='loose' y_correct = {'rifer' 'rider' 'cider' 'coder' 'cooer' 'cooey' 'gooey' 'goosy' 'goose' 'loose'}; assert(isequal(word_lad_2(ary,st,des),y_correct))

ary = 1×17 cell array Columns 1 through 13 {'safer'} {'rifer'} {'upper'} {'rifre'} {'rider'} {'tider'} {'cider'} {'coder'} {'loder'} {'cooer'} {'cooey'} {'gooey'} {'goosy'} Columns 14 through 17 {'goose'} {'loose'} {'nosey'} {'doose'} st = 'refer' des = 'loose'