Cody

Problem 75. Find the palindrome

Solution 1197864

Submitted on 25 May 2017 by Augusto Mazzei
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
a = 'xkayakyy'; p = 'kayak'; assert(isequal(p,pal(a)));

d = -13 -10 24 -24 10 14 0 b = 'kayak'

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

d = Columns 1 through 29 -5 3 3 -3 4 4 -7 4 -1 -2 2 3 1 -2 2 -6 -1 1 5 -4 2 -4 4 -2 -1 0 5 -5 -1 Columns 30 through 58 5 2 -4 -5 2 6 0 -4 -3 8 -2 -6 5 3 -6 6 0 -6 4 -2 -4 -1 5 3 -6 -2 9 -2 -3 Columns 59 through 76 5 -5 0 1 4 -7 1 -3 7 1 -7 5 -2 -4 6 -4 6 -2 b = '46264'

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

d = Columns 1 through 29 -2 3 -9 13 -89 41 -41 83 -18 24 -63 -26 65 1 10 -7 -69 87 -22 18 -83 41 -41 69 13 -13 -69 41 -41 Columns 30 through 58 83 -18 22 -87 69 7 -10 -1 -53 -12 66 19 -1 -84 84 -12 -7 19 -84 73 10 -83 65 13 1 5 -12 -3 13 Columns 59 through 64 -82 83 1 -5 3 7 b = 'able was I ere I saw elba'