Cody

# Problem 42461. This is a palindrome and so am I

Solution 706171

Submitted on 24 Jul 2015 by Muthu Annamalai
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
%% s = 'a man a plan a canal panama'; assert(isequal(is_pal(s),true))

s = amanaplanacanalpanama y = 1

2   Pass
%% s = 'taco cat'; assert(isequal(is_pal(s),true))

s = tacocat y = 1

3   Pass
%% s = 'a man a plan canal panama'; assert(isequal(is_pal(s),false))

s = amanaplancanalpanama y = 0

4   Pass
%% s = char(randi(74,1,200)+'0'); assert(isequal(is_pal(s),false)); % most probably

s = eIfHutI\a;y:\t6wyf=Q62CZIi=e6QFcCy]?F>aYvl^p<7nXHO8xvvr_[_iUgfz_Z`IT:MT`3;Di<2<QIjs<@n=xl5GW633IQ?Q;Jm9xFPeau3TKXjy?YM1r8F@m\Vm[DGSl3[r;8qwv1HJ8vJ4^@St5FTX>Te@DtjAq;?<Oe_[oqrK9OqCxhqZ<M@kn;5:qBaJk2rn] y = 0

5   Pass
%% s = char(randi(74,1,200)+'0'); s = [s fliplr(s)]; assert(isequal(is_pal(s),true));

s = DZuv>k6R@4t?>89CgLo\@em3ZyQ@r4W5xGpGrfFD2hjrk3WJno_En`>PNIBL?lL4U;IdKr:Z1x^G6_W5]o3k>gaIcw2\@1GE>TxF<L[BicA<fH7YIpS4dmijXLy1i\OWvP>rVF;DJSOL>8lA^Id>JuVXqfBizvdJW6\L2B2^edrYTl_XdQ2Tk:<^Df;3JJylgUR9TQpCCpQT9RUglyJJ3;fD^<:kT2QdX_lTYrde^2B2L\6WJdvziBfqXVuJ>dI^Al8>LOSJD;FVr>PvWO\i1yLXjimd4SpIY7Hf<AciB[L<FxT>EG1@\2wcIag>k3o]5W_6G^x1Z:rKdI;U4Ll?LBINP>`nE_onJW3krjh2DFfrGpGx5W4r@QyZ3me@\oLgC98>?t4@R6k>vuZD y = 1

6   Pass
%% s = fileread('is_pal.m'); s = regexprep(s,'%This code written by profile_id.*','') assert(isequal(is_pal(s),true));

s = function y = is_pal(s_in) % s = strjoin(strsplit(s_in),'') % y = strcmpi(s,fliplr(s)) % ))s(rlpilf,s(ipmcrts = y % )'',)ni_s(tilpsrts(niojrts = s % )ni_s(lap_si = y noitcnuf s = functiony=is_pal(s_in)%s=strjoin(strsplit(s_in),'')%y=strcmpi(s,fliplr(s))%))s(rlpilf,s(ipmcrts=y%)'',)ni_s(tilpsrts(niojrts=s%)ni_s(lap_si=ynoitcnuf y = 1