Problem 65. Word Counting and Indexing
Solution Stats
Problem Comments
-
14 Comments
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.
The test suite has been modified to check the indexing cell array as well. Further modifications will be done shortly.
Last test is interesting! Nice brainscratcher
I must say I do not agree with the bad comments which have been given to this test. I think it is explained properly and the tests seem to me appropriate.
https://blog.csdn.net/qq_44846756/article/details/116567963
have the answer
enjoyed this problem!
Solution Comments
-
2 Comments
One of the most absurd and pointless problems.
Complete waste of time.
Or maybe you don't understand the intricacy of the problem.
-
1 Comment
Pointless and confusing
-
1 Comment
Pretty kooky final test...
-
1 Comment
There seems to be no check on the word indexing part of the problem. I passed the test suite without indexing at all.
-
2 Comments
s1 = {'this is',...
'a cruel',...
'joke'};
true ;(
and now this happened
-
1 Comment
Cheating with empty index output
-
1 Comment
str1 = {'one'} {'two'} {'three'} {'four'}
str2 = {'one'} {'three'} {'two'} {'four'}
-
1 Comment
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.
-
1 Comment
The test suite doesn't even test half of what the problem asks for,
-
1 Comment
This solution properly solves for the string_index_list output, though this is not checked in the test suite.
-
1 Comment
Obviously, the index list is not checked...
-
1 Comment
The test suite does not check the 2nd output argument. This solution is not correct.
-
1 Comment
I forgot to do the str_index_lst, but the evaluator still accepted this. This should really be rejected as a solution.
Problem Recent Solvers1285
Suggested Problems
-
Remove any row in which a NaN appears
7928 Solvers
-
1372 Solvers
-
1355 Solvers
-
Basic electricity in a dry situation
542 Solvers
-
614 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!