Cody

Problem 92. Find state names that start with the letter N

Solution 2011166

Submitted on 9 Nov 2019 by Jackson Cocks
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
s1 = 'North Carolina Tennessee Texas Nebraska Maine'; s2 = ' Tennessee Texas Maine'; assert(isequal(s2,refcn(s1)))

s2 = [] work = 6×1 cell array {'North' } {'Carolina' } {'Tennessee'} {'Texas' } {'Nebraska' } {'Maine' } a = 6 b = 1 c = 78 111 114 116 104 s2 = ' ' c = 67 97 114 111 108 105 110 97 c = 84 101 110 110 101 115 115 101 101 s2 = ' Tennessee' c = 84 101 120 97 115 s2 = ' Tennessee Texas' c = 78 101 98 114 97 115 107 97 s2 = ' Tennessee Texas ' c = 77 97 105 110 101 s2 = ' Tennessee Texas Maine' s2 = ' Tennessee Texas Maine' [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In refcn (line 15) In ScoringEngineTestPoint1 (line 5) In solutionTest (line 3)]

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

s2 = [] work = 14×1 cell array {'Nebraska' } {'Nevada' } {'New' } {'Hampshire'} {'New' } {'Jersey' } {'New' } {'Mexico' } {'New' } {'York' } {'North' } {'Carolina' } {'North' } {'Dakota' } a = 14 b = 1 c = 78 101 98 114 97 115 107 97 s2 = ' ' c = 78 101 118 97 100 97 s2 = ' ' c = 78 101 119 s2 = ' ' c = 72 97 109 112 115 104 105 114 101 c = 78 101 119 s2 = ' ' c = 74 101 114 115 101 121 c = 78 101 119 s2 = ' ' c = 77 101 120 105 99 111 c = 78 101 119 s2 = ' ' c = 89 111 114 107 c = 78 111 114 116 104 s2 = ' ' c = 67 97 114 111 108 105 110 97 c = 78 111 114 116 104 s2 = ' ' c = 68 97 107 111 116 97 s2 = ' ' [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In refcn (line 15) In ScoringEngineTestPoint2 (line 5) In solutionTest (line 5)]

3   Pass
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)))

s2 = [] work = 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' } a = 60 b = 1 c = 65 108 97 98 97 109 97 c = 65 108 97 115 107 97 s2 = ' Alaska' c = 65 114 105 122 111 110 97 s2 = ' Alaska Arizona' c = 65 114 107 97 110 115 97 115 s2 = ' Alaska Arizona Arkansas' c = 67 97 108 105 102 111 114 110 105 97 s2 = ' Alaska Arizona Arkansas California' c = 67 111 108 111 114 97 100 111 s2 = ' Alaska Arizona Arkansas California Colorado' c = 67 111 110 110 101 99 116 105 99 117 116 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut' c = 68 101 108 97 119 97 114 101 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware' c = 70 108 111 114 105 100 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida' c = 71 101 111 114 103 105 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia' c = 72 97 119 97 105 105 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii' c = 73 100 97 104 111 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho' c = 73 108 108 105 110 111 105 115 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois' c = 73 110 100 105 97 110 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana' c = 73 111 119 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa' c = 75 97 110 115 97 115 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas' c = 75 101 110 116 117 99 107 121 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky' c = 76 111 117 105 115 105 97 110 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana' c = 77 97 105 110 101 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine' c = 77 97 114 121 108 97 110 100 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland' c = 77 97 115 115 97 99 104 117 115 101 116 116 115 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts' c = 77 105 99 104 105 103 97 110 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan' c = 77 105 110 110 101 115 111 116 97 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota' c = 77 105 115 115 105 115 115 105 112 112 105 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi' c = 77 105 115 115 111 117 114 105 s2 = ' Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri' c = 77 111 110 116 97 110 97 s2 = ' 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' c = 78 101 98 114 97 115 107 97 s2 = ' 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 ' c = 78 101 118 97 100 97 s2 = ' 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 ' c = 78 101 119 s2 = ' 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 ' c = 72 97 109 112 115 104 105 114 101 c = 78 101 119 s2 = ' 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 ' c = 74 101 114 115 101 121 c = 78 101 119 s2 = ' 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 ' c = 77 101 120 105 99 111 c = 78 101 119 s2 = ' 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 ' c = 89 111 114 107 c = 78 111 114 116 104 s2 = ' 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 ' c = 67 97 114 111 108 105 110 97 c = 78 111 114 116 104 s2 = ' 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 ' c = 68 97 107 111 116 97 c = 79 104 105 111 s2 = ' 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' c = 79 107 108 97 104 111 109 97 s2 = ' 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' c = 79 114 101 103 111 110 s2 = ' 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' c = 80 101 110 110 115 121 108 118 97 110 105 97 s2 = ' 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' c = 82 104 111 100 101 s2 = ' 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 Pennsylva...