This passes in R2017b, yet fails here. Why?
Actually this code won't pass the Test Suite on any version of MATLAB. The misunderstanding is caused by rendering of HTML text on Cody, which means that double-spaces are not _displayed_ in the Test Suite's solutions; nevertheless, the correct solutions do contain double spaces, as you can confirm by viewing the HTML source, and as also explained in the problem statement. Your code is removing some spaces. I'm sure you can fix it now, with this knowledge.
Thanks for clarifying. I appreciate it.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
s1 = 'The rain in Spain falls mainly on the plain';
s2 = 'The in falls mainly on the ';
assert(strcmp(remAin(s1),s2));
|
2 | Fail |
s1 = 'The pain from my migraine makes me complain';
s2 = 'The from my migraine makes me ';
assert(strcmp(remAin(s1),s2));
|
3 | Fail |
s1 = 'I had to explain that "ain" is not a word';
s2 = 'I had to that "" is not a word';
assert(strcmp(remAin(s1),s2));
|
2530 Solvers
Project Euler: Problem 9, Pythagorean numbers
158 Solvers
Back to basics 22 - Rotate a matrix
682 Solvers
Return unique values without sorting
488 Solvers
324 Solvers