Something is broken on the third test case. I think the blank line between the 2nd and 3rd line of text is what's messing it up.
I submitted a solution that works for the first two cases and outputs perfect result (including the index output) for the last case on my desktop.
Somebody at the Cody team should check their test cases.
There is a workaround for the broken 3rd test case:
Because of the empty line, the size of sl is 2x2 instead of 1x4. So to bring sl into proper shape, just do str_list = str_list(:)' at the beginning of your code. This will leave the input for the first two test cases unchanged.
Thank you Jan for the workaround for the third test case.
Test suite doesn't check whether str_index_list is correct or not. It's incomplete.
There seems to be no check on the word indexing part of the problem. I passed the test suite without indexing at all.
If non-vector input lists are valid inputs (test case 3), this should be stated explicitly in the problem description
I know people are complaining about indexes, but the problem did not state how indexes should be created. And if there is no requirement, anything can be true.
tough for me to create the right index.
Problem has been broken for YEARS!!!! Needs to be fixed or removed!!!! word index lists are never even checked. Third test case has a bug in input.
Pretty kooky final test...
There seems to be no check on the word indexing part of the problem. I passed the test suite without indexing at all.
s1 = {'this is',...
'a cruel',...
'joke'};
true ;(
and now this happened
Cheating with empty index output
str1 = {'one'} {'two'} {'three'} {'four'}
str2 = {'one'} {'three'} {'two'} {'four'}
the third test case may be broken, I can find no difference between my output and the output listed, and on my matlab the assertion does not fail.
The test suite doesn't even test half of what the problem asks for,
This solution properly solves for the string_index_list output, though this is not checked in the test suite.
Obviously, the index list is not checked...
The test suite does not check the 2nd output argument. This solution is not correct.
I forgot to do the str_index_lst, but the evaluator still accepted this. This should really be rejected as a solution.
17214 Solvers
Project Euler: Problem 2, Sum of even Fibonacci
835 Solvers
Find a subset that divides the vector into equal halves
332 Solvers
Rotate input square matrix 90 degrees CCW without rot90
380 Solvers
216 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!