Cody

Solution 1982249

Submitted on 19 Oct 2019 at 2:49
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
s1 = 'North Carolina Tennessee Texas Nebraska Maine'; s2 = ' Tennessee Texas Maine'; assert(isequal(s2,refcn(s1)))

a = 6×1 cell array {'North' } {'Carolina' } {'Tennessee'} {'Texas' } {'Nebraska' } {'Maine' } j = 0 i = 1 b = 1×1 cell array {'North'} b = 'North' a = 5×1 cell array {'Carolina' } {'Tennessee'} {'Texas' } {'Nebraska' } {'Maine' } j = 1 i = 1 b = 1×1 cell array {'Carolina'} b = 'Carolina' i = 2 b = 1×1 cell array {'Tennessee'} b = 'Tennessee' i = 3 b = 1×1 cell array {'Texas'} b = 'Texas' i = 4 b = 1×1 cell array {'Nebraska'} b = 'Nebraska' a = 4×1 cell array {'Carolina' } {'Tennessee'} {'Texas' } {'Maine' } j = 2 i = 4 b = 1×1 cell array {'Maine'} b = 'Maine' s2 = 4×1 cell array {'Carolina' } {'Tennessee'} {'Texas' } {'Maine' }

Undefined function 'cell2str' for input arguments of type 'cell'. Error in refcn (line 14) s2=cell2str(s2) Error in Test1 (line 5) assert(isequal(s2,refcn(s1)))

2   Fail
s1 = 'Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota'; s2 = ' '; assert(isequal(s2,refcn(s1)))

a = 14×1 cell array {'Nebraska' } {'Nevada' } {'New' } {'Hampshire'} {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 0 i = 1 b = 1×1 cell array {'Nebraska'} b = 'Nebraska' a = 13×1 cell array {'Nevada' } {'New' } {'Hampshire'} {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 1 i = 1 b = 1×1 cell array {'Nevada'} b = 'Nevada' a = 12×1 cell array {'New' } {'Hampshire'} {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 2 i = 1 b = 1×1 cell array {'New'} b = 'New' a = 11×1 cell array {'Hampshire'} {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 3 i = 1 b = 1×1 cell array {'Hampshire'} b = 'Hampshire' i = 2 b = 1×1 cell array {'New'} b = 'New' a = 10×1 cell array {'Hampshire'} {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 4 i = 2 b = 1×1 cell array {'Jersey'} b = 'Jersey' i = 3 b = 1×1 cell array {'New'} b = 'New' a = 9×1 cell array {'Hampshire'} {'Jersey' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 5 i = 3 b = 1×1 cell array {'Mexico'} b = 'Mexico' i = 4 b = 1×1 cell array {'New'} b = 'New' a = 8×1 cell array {'Hampshire'} {'Jersey' } {'Mexico' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } j = 6 i = 4 b = 1×1 cell array {'York'} b = 'York' i = 5 b = 1×1 cell array {'North'} b = 'North' a = 7×1 cell array {'Hampshire'} {'Jersey' } {'Mexico' } {'York' } {'Carolina' } {'North' } {'Dakota' } j = 7 i = 5 b = 1×1 cell array {'Carolina'} b = 'Carolina' i = 6 b = 1×1 cell array {'North'} b = 'North' a = 6×1 cell array {'Hampshire'} {'Jersey' } {'Mexico' } {'York' } {'Carolina' } {'Dakota' } j = 8 i = 6 b = 1×1 cell array {'Dakota'} b = 'Dakota' s2 = 6×1 cell array {'Hampshire'} {'Jersey' } {'Mexico' } {'York' } {'Carolina' } {'Dakota' }

Undefined function 'cell2str' for input arguments of type 'cell'. Error in refcn (line 14) s2=cell2str(s2) Error in Test2 (line 5) assert(isequal(s2,refcn(s1)))

3   Fail
s1 = 'Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming'; s2 = 'Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming'; assert(isequal(s2,refcn(s1)))

a = 60×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'Nebraska' } {'Nevada' } {'New' } {'Hampshire' } {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' } {'Island' } {'South' } {'Carolina' } {'South' } {'Dakota' } {'Tennessee' } {'Texas' } {'Utah' } {'Vermont' } {'Virginia' } {'Washington' } {'West' } {'Virginia' } {'Wisconsin' } {'Wyoming' } j = 0 i = 1 b = 1×1 cell array {'Alabama'} b = 'Alabama' i = 2 b = 1×1 cell array {'Alaska'} b = 'Alaska' i = 3 b = 1×1 cell array {'Arizona'} b = 'Arizona' i = 4 b = 1×1 cell array {'Arkansas'} b = 'Arkansas' i = 5 b = 1×1 cell array {'California'} b = 'California' i = 6 b = 1×1 cell array {'Colorado'} b = 'Colorado' i = 7 b = 1×1 cell array {'Connecticut'} b = 'Connecticut' i = 8 b = 1×1 cell array {'Delaware'} b = 'Delaware' i = 9 b = 1×1 cell array {'Florida'} b = 'Florida' i = 10 b = 1×1 cell array {'Georgia'} b = 'Georgia' i = 11 b = 1×1 cell array {'Hawaii'} b = 'Hawaii' i = 12 b = 1×1 cell array {'Idaho'} b = 'Idaho' i = 13 b = 1×1 cell array {'Illinois'} b = 'Illinois' i = 14 b = 1×1 cell array {'Indiana'} b = 'Indiana' i = 15 b = 1×1 cell array {'Iowa'} b = 'Iowa' i = 16 b = 1×1 cell array {'Kansas'} b = 'Kansas' i = 17 b = 1×1 cell array {'Kentucky'} b = 'Kentucky' i = 18 b = 1×1 cell array {'Louisiana'} b = 'Louisiana' i = 19 b = 1×1 cell array {'Maine'} b = 'Maine' i = 20 b = 1×1 cell array {'Maryland'} b = 'Maryland' i = 21 b = 1×1 cell array {'Massachusetts'} b = 'Massachusetts' i = 22 b = 1×1 cell array {'Michigan'} b = 'Michigan' i = 23 b = 1×1 cell array {'Minnesota'} b = 'Minnesota' i = 24 b = 1×1 cell array {'Mississippi'} b = 'Mississippi' i = 25 b = 1×1 cell array {'Missouri'} b = 'Missouri' i = 26 b = 1×1 cell array {'Montana'} b = 'Montana' i = 27 b = 1×1 cell array {'Nebraska'} b = 'Nebraska' a = 59×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'Nevada' } {'New' } {'Hampshire' } {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' } {'Island' } {'South' } {'Carolina' } {'South' } {'Dakota' } {'Tennessee' } {'Texas' } {'Utah' } {'Vermont' } {'Virginia' } {'Washington' } {'West' } {'Virginia' } {'Wisconsin' } {'Wyoming' } j = 1 i = 27 b = 1×1 cell array {'Nevada'} b = 'Nevada' a = 58×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'New' } {'Hampshire' } {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' } {'Island' } {'South' } {'Carolina' } {'South' } {'Dakota' } {'Tennessee' } {'Texas' } {'Utah' } {'Vermont' } {'Virginia' } {'Washington' } {'West' } {'Virginia' } {'Wisconsin' } {'Wyoming' } j = 2 i = 27 b = 1×1 cell array {'New'} b = 'New' a = 57×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'Hampshire' } {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' } {'Island' } {'South' } {'Carolina' } {'South' } {'Dakota' } {'Tennessee' } {'Texas' } {'Utah' } {'Vermont' } {'Virginia' } {'Washington' } {'West' } {'Virginia' } {'Wisconsin' } {'Wyoming' } j = 3 i = 27 b = 1×1 cell array {'Hampshire'} b = 'Hampshire' i = 28 b = 1×1 cell array {'New'} b = 'New' a = 56×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'Hampshire' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' } {'Island' } {'South' } {'Carolina' } {'South' } {'Dakota' } {'Tennessee' } {'Texas' } {'Utah' } {'Vermont' } {'Virginia' } {'Washington' } {'West' } {'Virginia' } {'Wisconsin' } {'Wyoming' } j = 4 i = 28 b = 1×1 cell array {'Jersey'} b = 'Jersey' i = 29 b = 1×1 cell array {'New'} b = 'New' a = 55×1 cell array {'Alabama' } {'Alaska' } {'Arizona' } {'Arkansas' } {'California' } {'Colorado' } {'Connecticut' } {'Delaware' } {'Florida' } {'Georgia' } {'Hawaii' } {'Idaho' } {'Illinois' } {'Indiana' } {'Iowa' } {'Kansas' } {'Kentucky' } {'Louisiana' } {'Maine' } {'Maryland' } {'Massachusetts'} {'Michigan' } {'Minnesota' } {'Mississippi' } {'Missouri' } {'Montana' } {'Hampshire' } {'Jersey' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } {'Ohio' } {'Oklahoma' } {'Oregon' } {'Pennsylvania' } {'Rhode' ...

Undefined function 'cell2str' for input arguments of type 'cell'. Error in refcn (line 14) s2=cell2str(s2) Error in Test3 (line 5) assert(isequal(s2,refcn(s1)))