In addition to vowels, the second test also removes a space. While it's natural to want to clean up extra spaces, spaces are _not_ vowels.
The display of the test suite show the second space at the "I" being removed, but the actual test does not remove it. This is very confusing, but the test actually works as you would expect. It is just that the displayed "correct" answer is - in fact - not correct as you noted.
I had trouble with this as I saw your answer and accommodated their "error" in my solution. Except their error was only a display error and not an actual error in the test suite. Doh!
See https://www.mathworks.com/matlabcentral/cody/problems/22-remove-the-vowels/solutions/1218453 for a repaired version of your solution.
Of course I just noted that your solution is five months old, so you certainly won't care by now. C'est la vie.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
s1 = 'Jack and Jill went up the hill';
s2 = 'Jck nd Jll wnt p th hll';
assert(isequal(s2,refcn(s1)))
|
2 | Fail |
s1 = 'I don''t want to work. I just want to bang on the drum all day.';
s2 = ' dn''t wnt t wrk. jst wnt t bng n th drm ll dy.';
assert(isequal(s2,refcn(s1)))
|
Back to basics 22 - Rotate a matrix
763 Solvers
321 Solvers
260 Solvers
664 Solvers
Calculate Amount of Cake Frosting
7517 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!