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'
out =
100 1 2 7 5
out2 =
1×4 cell array
{'CORD'} {'CARD'} {'WARD'} {'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'
out =
100 1 4 12 13 9 11
out2 =
1×6 cell array
{'pan'} {'pat'} {'put'} {'aut'} {'apt'} {'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'
out =
100 2 8 10
out2 =
1×3 cell array
{'hot'} {'hog'} {'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'
out =
100 2 5 7 8 10 11 12 13 14 15
out2 =
1×10 cell array
{'rifer'} {'rider'} {'cider'} {'coder'} {'cooer'} {'cooey'} {'gooey'} {'goosy'} {'goose'} {'loose'}
|
Find state names that start with the letter N
598 Solvers
54 Solvers
Number of 1s in a binary string
2824 Solvers
Change the sign of even index entries of the reversed vector
296 Solvers
43 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!