Cody

Solution 2641579

Submitted on 1 Jul 2020 by Jerry Wright
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)));

ans = 1 0 radius = 1 ans = 1.5000 0.5000 ans = 2 0 radius = 1 ans = 2.5000 0.5000 ans = 3 0 radius = 1 ans = 3.5000 0.5000 ans = 4 0 radius = 1 sub = 'aya' ss = 'aya' radius = 2 sub = 'kayak' ss = 'kayak' radius = 3 ans = 4.5000 0.5000 ans = 5 0 radius = 1 ans = 5.5000 0.5000 ans = 6 0 radius = 1 ans = 6.5000 0.5000 ans = 7 0 radius = 1 ans = 7.5000 0.5000 ans = 8 0 ans = 8.5000 0.5000

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

ans = 1 0 radius = 1 ans = 1.5000 0.5000 ans = 2 0 radius = 1 ans = 2.5000 0.5000 ans = 3 0 radius = 1 ans = 3.5000 0.5000 ans = 4 0 radius = 1 sub = '141' ss = '141' radius = 2 ans = 4.5000 0.5000 ans = 5 0 radius = 1 ans = 5.5000 0.5000 ans = 6 0 radius = 1 ans = 6.5000 0.5000 ans = 7 0 radius = 1 ans = 7.5000 0.5000 ans = 8 0 radius = 1 ans = 8.5000 0.5000 ans = 9 0 radius = 1 ans = 9.5000 0.5000 ans = 10 0 radius = 1 ans = 10.5000 0.5000 ans = 11 0 radius = 1 sub = '535' radius = 2 ans = 11.5000 0.5000 ans = 12 0 radius = 1 ans = 12.5000 0.5000 ans = 13 0 radius = 1 ans = 13.5000 0.5000 ans = 14 0 radius = 1 ans = 14.5000 0.5000 ans = 15 0 radius = 1 sub = '979' radius = 2 ans = 15.5000 0.5000 ans = 16 0 radius = 1 ans = 16.5000 0.5000 ans = 17 0 radius = 1 ans = 17.5000 0.5000 ans = 18 0 radius = 1 sub = '323' radius = 2 ans = 18.5000 0.5000 ans = 19 0 radius = 1 ans = 19.5000 0.5000 ans = 20 0 radius = 1 ans = 20.5000 0.5000 ans = 21 0 radius = 1 ans = 21.5000 0.5000 ans = 22 0 radius = 1 ans = 22.5000 0.5000 ans = 23 0 radius = 1 sub = '626' radius = 2 sub = '46264' ss = '46264' radius = 3 ans = 23.5000 0.5000 ans = 24 0 radius = 1 ans = 24.5000 0.5000 ans = 25 0 radius = 1 ans = 25.5000 0.5000 ans = 26 0 radius = 1 ans = 26.5000 0.5000 sub = '33' radius = 1.5000 ans = 27 0 radius = 1 ans = 27.5000 0.5000 ans = 28 0 radius = 1 sub = '383' radius = 2 ans = 28.5000 0.5000 ans = 29 0 radius = 1 ans = 29.5000 0.5000 ans = 30 0 radius = 1 ans = 30.5000 0.5000 ans = 31 0 radius = 1 ans = 31.5000 0.5000 ans = 32 0 radius = 1 ans = 32.5000 0.5000 ans = 33 0 radius = 1 ans = 33.5000 0.5000 ans = 34 0 radius = 1 ans = 34.5000 0.5000 ans = 35 0 radius = 1 ans = 35.5000 0.5000 ans = 36 0 radius = 1 ans = 36.5000 0.5000 sub = '88' radius = 1.5000 ans = 37 0 radius = 1 ans = 37.5000 0.5000 ans = 38 0 radius = 1 ans = 38.5000 0.5000 ans = 39 0 radius = 1 ans = 39.5000 0.5000 ans = 40 0 radius = 1 ans = 40.5000 0.5000 ans = 41 0 radius = 1 ans = 41.5000 0.5000 ans = 42 0 radius = 1 ans = 42.5000 0.5000 ans = 43 0 radius = 1 ans = 43.5000 0.5000 ans = 44 0 radius = 1 ans = 44.5000 0.5000 ans = 45 0 radius = 1 sub = '939' radius = 2 ans = 45.5000 0.5000 ans = 46 0 radius = 1 ans = 46.5000 0.5000 sub = '99' radius = 1.5000 sub = '3993' radius = 2.5000 ans = 47 0 radius = 1 ans = 47.5000 0.5000 ans = 48 0 radius = 1 ans = 48.5000 0.5000 ans = 49 0 radius = 1 ans = 49.5000 0.5000 ans = 50 0 radius = 1 ans = 50.5000 0.5000 ans = 51 0 radius = 1 ans = 51.5000 0.5000 ans = 52 0 radius = 1 ans = 52.5000 0.5000 ans = 53 0 radius = 1 ans = 53.5000 0.5000 ans = 54 0 radius = 1 ans = 54.5000 0.5000 ans = 55 0 radius = 1 ans = 55.5000 0.5000 ans = 56 0 radius = 1 ans = 56.5000 0.5000 ans = 57 0 radius = 1 ans = 57.5000 0.5000 ans = 58 0 radius = 1 ans = 58.5000 0.5000 ans = 59 0 radius = 1 ans = 59.5000 0.5000 ans = 60 0 radius = 1 sub = '494' radius = 2 ans = 60.5000 0.5000 ans = 61 0 radius = 1 ans = 61.5000 0.5000 sub = '44' radius = 1.5000 ans = 62 0 radius = 1 ans = 62.5000 0.5000 ans = 63 0 radius = 1 ans = 63.5000 0.5000 ans = 64 0 radius = 1 ans = 64.5000 0.5000 ans = 65 0 radius = 1 ans = 65.5000 0.5000 ans = 66 0 radius = 1 ans = 66.5000 0.5000 ans = 67 0 radius = 1 ans = 67.5000 0.5000 ans = 68 0 radius = 1 ans = 68.5000 0.5000 ans = 69 0 radius = 1 ans = 69.5000 0.5000 ans = 70 0 radius = 1 ans = 70.5000 0.5000 ans = 71 0 radius = 1 ans = 71.5000 0.5000 ans = 72 0 radius = 1 ans = 72.5000 0.5000 ans = 73 0 radius = 1 ans = 73.5000 0.5000 ans = 74 0 radius = 1 ans = 74.5000 0.5000 ans = 75 0 radius = 1 ans = 75.5000 0.5000 ans = 76 0 radius = 1 ans = 76.5000 0.5000 ans = 77 0 ans = 77.5000 0.5000

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

ans = 1 0 radius = 1 ans = 1.5000 0.5000 ans = 2 0 radius = 1 ans = 2.5000 0.5000 ans = 3 0 radius = 1 ans = 3.5000 0.5000 ans = 4 0 radius = 1 ans = 4.5000 0.5000 ans = 5 0 radius = 1 ans = 5.5000 0.5000 ans = 6 0 radius = 1 ans = 6.5000 0.5000 ans = 7 0 radius = 1 sub = ' I ' ss = ' I ' radius = 2 ans = 7.5000 0.5000 ans = 8 0 radius = 1 ans = 8.5000 0.5000 ans = 9 0 radius = 1 ans = 9.5000 0.5000 ans = 10 0 radius = 1 ans = 10.5000 0.5000 ans = 11 0 radius = 1 ans = 11.5000 0.5000 ans = 12 0 radius = 1 ans = 12.5000 0.5000 ans = 13 0 radius = 1 ans = 13.5000 0.5000 ans = 14 0 radius = 1 ans = 14.5000 0.5000 ans = 15 0 radius = 1 ans = 15.5000 0.5000 ans = 16 0 radius = 1 ans = 16.5000 0.5000 ans = 17 0 radius = 1 ans = 17.5000 0.5000 ans = 18 0 radius = 1 ans = 18.5000 0.5000 ans = 19 0 radius = 1 ans = 19.5000 0.5000 ans = 20 0 radius = 1 ans = 20.5000 0.5000 ans = 21 0 radius = 1 ans = 21.5000 0.5000 ans = 22 0 radius = 1 ans = 22.5000 0.5000 ans = 23 0 radius = 1 sub = ' I ' radius = 2 ans = 23.5000 0.5000 ans = 24 0 radius = 1 ans = 24.5000 0.5000 ans = 25 0 radius = 1 ans = 25.5000 0.5000 ans = 26 0 radius = 1 sub = 'ere' radius = 2 sub = ' ere ' ss = ' ere ' radius = 3 sub = 'I ere I' ss = 'I ere I' radius = 4 sub = ' I ere I ' ss = ' I ere I ' radius = 5 sub = 's I ere I s' ss = 's I ere I s' radius = 6 sub = 'as I ere I sa' ss = 'as I ere I sa' radius = 7 sub = 'was I ere I saw' ss = 'was I ere I saw' radius = 8 sub = ' was I ere I saw ' ss = ' was I ere I saw ' radius = 9 sub = 'e was I ere I saw e' ss = 'e was I ere I saw e' radius = 10 sub = 'le was I ere I saw el' ss = 'le was I ere I saw el' radius = 11 sub = 'ble was I ere I saw elb' ss = 'ble was I ere I saw elb' radius = 12 sub = 'able was I ere I saw elba' ss = 'able was I ere I saw elba' radius = 13 ans = 26.5000 0.5000 ans = 27 0 radius = 1 ans = 27.5000 0.5000 ans = 28 0 radius = 1 ans = 28.5000 0.5000 ans = 29 0 radius = 1 sub = ' I ' radius = 2 ans = 29.5000 0.5000 ans = 30 0 radius = 1 ans = 30.5000 0.5000 ans = 31 0 radius = 1 ans = 31.5000 0.5000 ans = 32 0 radius = 1 ans = 32.5000 0.5000 ans = 33 0 radius = 1 ans = 33.5000 0.5000 ans = 34 0 radius = 1 ans = 34.5000 0.5000 ans = 35 0 radius = 1 ans = 35.5000 0.5000 ans = 36 0 radius = 1 ans = 36.5000 0.5000 ans = 37 0 radius = 1 ans = 37.5000 0.5000 ans = 38 0 radius = 1 ans = 38.5000 0.5000 ans = 39 0 radius = 1 ans = 39.5000 0.5000 ans = 40 0 radius = 1 ans = 40.5000 0.5000 ans = 41 0 radius = 1 ans = 41.5000 0.5000 ans = 42 0 radius = 1 ans = 42.5000 0.5000 ans = 43 0 radius = 1 ans = 43.5000 0.5000 ans = 44 0 radius = 1 sub = 't t' radius = 2 ans = 44.5000 0.5000 ans = 45 0 radius = 1 ans = 45.5000 0.5000 ans = 46 0 radius = 1 ans = 46.5000 0.5000 ans = 47 0 radius = 1 ans = 47.5000 0.5000 ans = 48 0 radius = 1 ans = 48.5000 0.5000 ans = 49 0 radius = 1 ans = 49.5000 0.5000 ans = 50 0 radius = 1 ans = 50.5000 0.5000 ans = 51 0 radius = 1 ans = 51.5000 0.5000 ans = 52 0 radius = 1 ans = 52.5000 0.5000 ans = 53 0 radius = 1 ans = 53.5000 0.5000 ans = 54 0 radius = 1 ans = 54.5000 0.5000 ans = 55 0 radius = 1 ans = 55.5000 0.5000 ans = 56 0 radius = 1 ans = 56.5000 0.5000 ans = 57 0 radius = 1 ans = 57.5000 0.5000 ans = 58 0 radius = 1 ans = 58.5000 0.5000 ans = 59 0 radius = 1 ans = 59.5000 0.5000 ans = 60 0 radius = 1 ans = 60.5000 0.5000 ans = 61 0 radius = 1 ans = 61.5000 0.5000 ans = 62 0 radius = 1 ans = 62.5000 0.5000 ans = 63 0 radius = 1 ans = 63.5000 0.5000 ans = 64 0 radius = 1 ans = 64.5000 0.5000 ans = 65 0 ans = 65.5000 0.5000

Suggested Problems

More from this Author95