Cody

# Problem 75. Find the palindrome

Solution 1925718

Submitted on 8 Sep 2019
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
a = 'xkayakyy'; p = 'kayak'; assert(isequal(p,pal(a)));

s = 1×7 cell array {'yy'} {'ka'} {'ya'} {'aya'} {'ak'} {'yak'} {'ayak'}

Assertion failed.

2   Fail
a = '3.141592653589793238462643383279502884197169399375105820974944592307816406286'; p = '46264'; assert(isequal(p,pal(a)));

s = 1×60 cell array Columns 1 through 17 {'82'} {'26'} {'46'} {'32'} {'95'} {'44'} {'94'} {'494'} {'79'} {'02'} {'28'} {'028'} {'50'} {'15'} {'39'} {'99'} {'93'} Columns 18 through 34 {'993'} {'3993'} {'39'} {'939'} {'79'} {'14'} {'88'} {'82'} {'20'} {'820'} {'05'} {'59'} {'97'} {'23'} {'38'} {'238'} {'83'} Columns 35 through 50 {'383'} {'33'} {'46'} {'62'} {'26'} {'626'} {'64'} {'264'} {'6264'} {'46264'} {'83'} {'32'} {'832'} {'23'} {'323'} {'39'} Columns 51 through 60 {'97'} {'79'} {'979'} {'35'} {'535'} {'62'} {'95'} {'51'} {'41'} {'141'}

Assertion failed.

3   Fail
a = 'truly I say: able was I ere I saw elba, but that is another story'; p = 'able was I ere I saw elba'; assert(isequal(p,pal(a)));

s = 1×242 cell array Columns 1 through 17 {'ot'} {'s '} {'re'} {'to'} {' s'} {' t'} {'t '} {' t'} {'t t'} {'ab'} {'bl'} {'abl'} {'le'} {'ble'} {'able'} {'e '} {'le '} Columns 18 through 31 {'ble '} {'able '} {' w'} {'e w'} {'le w'} {'ble w'} {'able w'} {'wa'} {' wa'} {'e wa'} {'le wa'} {'ble wa'} {'able wa'} {'as'} Columns 32 through 44 {'was'} {' was'} {'e was'} {'le was'} {'ble was'} {'able was'} {'s '} {'as '} {'was '} {' was '} {'e was '} {'le was '} {'ble was '} Columns 45 through 57 {'able was '} {' I'} {'s I'} {'as I'} {'was I'} {' was I'} {'e was I'} {'le was I'} {'ble was I'} {'able was I'} {'I '} {' I '} {'s I '} Columns 58 through 69 {'as I '} {'was I '} {' was I '} {'e was I '} {'le was I '} {'ble was I '} {'able was I '} {' e'} {'I e'} {' I e'} {'s I e'} {'as I e'} Columns 70 through 81 {'was I e'} {' was I e'} {'e was I e'} {'le was I e'} {'ble was I e'} {'able was I e'} {'er'} {'re'} {'ere'} {'e '} {'re '} {'ere '} Columns 82 through 95 {' ere '} {' I'} {'e I'} {'re I'} {'ere I'} {' ere I'} {'I ere I'} {'I '} {' I '} {'e I '} {'re I '} {'ere I '} {' ere I '} {'I ere I '} Columns 96 through 107 {' I ere I '} {' s'} {'I s'} {' I s'} {'e I s'} {'re I s'} {'ere I s'} {' ere I s'} {'I ere I s'} {' I ere I s'} {'s I ere I s'} {'sa'} Columns 108 through 118 {' sa'} {'I sa'} {' I sa'} {'e I sa'} {'re I sa'} {'ere I sa'} {' ere I sa'} {'I ere I sa'} {' I ere I sa'} {'s I ere I sa'} {'as I ere I sa'} Columns 119 through 129 {'aw'} {'saw'} {' saw'} {'I saw'} {' I saw'} {'e I saw'} {'re I saw'} {'ere I saw'} {' ere I saw'} {'I ere I saw'} {' I ere I saw'} Columns 130 through 140 {'s I ere I saw'} {'as I ere I saw'} {'was I ere I saw'} {'w '} {'aw '} {'saw '} {' saw '} {'I saw '} {' I saw '} {'e I saw '} {'re I saw '} Columns 141 through 148 {'ere I saw '} {' ere I saw '} {'I ere I saw '} {' I ere I saw '} {'s I ere I saw '} {'as I ere I saw '} {'was I ere I saw '} {' was I ere I saw '} Columns 149 through 159 {' e'} {'w e'} {'aw e'} {'saw e'} {' saw e'} {'I saw e'} {' I saw e'} {'e I saw e'} {'re I saw e'} {'ere I saw e'} {' ere I saw e'} Columns 160 through 167 {'I ere I saw e'} {' I ere I saw e'} {'s I ere I saw e'} {'as I ere I saw e'} {'was I ere I saw e'} {' was I ere I sa…'} {'e was I ere I s…'} {'el'} Columns 168 through 178 {' el'} {'w el'} {'aw el'} {'saw el'} {' saw el'} {'I saw el'} {' I saw el'} {'e I saw el'} {'re I saw el'} {'ere I saw el'} {' ere I saw el'} Columns 179 through 185 {'I ere I saw el'} {' I ere I saw el'} {'s I ere I saw el'} {'as I ere I saw el'} {'was I ere I saw…'} {' was I ere I sa…'} {'e was I ere I s…'} Columns 186 through 196 {'le was I ere I …'} {'lb'} {'elb'} {' elb'} {'w elb'} {'aw elb'} {'saw elb'} {' saw elb'} {'I saw elb'} {' I saw elb'} {'e I saw elb'} Columns 197 through 203 {'re I saw elb'} {'ere I saw elb'} {' ere I saw elb'} {'I ere I saw elb'} {' I ere I saw elb'} {'s I ere I saw elb'} {'as I ere I saw …'} Columns 204 through 212 {'was I ere I saw…'} {' was I ere I sa…'} {'e was I ere I s…'} {'le was I ere I …'} {'ble was I ere I…'} {'ba'} {'lba'} {'elba'} {' elba'} Columns 213 through 221 {'w elba'} {'aw elba'} {'saw elba'} {' saw elba'} {'I saw elba'} {' I saw elba'} {'e I saw elba'} {'re I saw elba'} {'ere I saw elba'} Columns 222 through 228 {' ere I saw elba'} {'I ere I saw elba'} {' I ere I saw elba'} {'s I ere I saw e…'} {'as I ere I saw …'} {'was I ere I saw…'} {' was I ere I sa…'} Columns 229 through 239 {'e was I ere I s…'} {'le was I ere I …'} {'ble was I ere I…'} {'able was I ere …'} {'as'} {'s '} {'as '} {' I'} {'s I'} {'as I'} {'I '} Columns 240 through 242 {' I '} {'s I '} {'as I '}

Assertion failed.