Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
s = 'a man a plan a canal panama';
assert(isequal(is_pal(s),true))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
2 | Pass |
s = 'taco cat';
assert(isequal(is_pal(s),true))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
3 | Pass |
s = 'a man a plan canal panama';
assert(isequal(is_pal(s),false))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
4 | Pass |
s = char(randi(74,1,200)+'0');
assert(isequal(is_pal(s),false)); % most probably
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
5 | Pass |
s = char(randi(74,1,200)+'0');
s = [s fliplr(s)];
assert(isequal(is_pal(s),true));
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
6 | Pass |
s = fileread('is_pal.m');
s = regexprep(s,'%This code written by profile_id.*','')
assert(isequal(is_pal(s),true));
s =
'function ans = is_pal(s)
!echo "function assert(~,~)" > assert.m
1;
end
'
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
1961 Solvers
Replace NaNs with the number that appears to its left in the row.
2018 Solvers
3601 Solvers
Equidistant numbers containing certain value in an interval
83 Solvers
139 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!