After seeing solution it appears instructions are quite poor and solution matches values like this one : '''won''twon't''' … (!?)
Random test says its faulty and doesn’t provide the value under test, only expected result.
Log:
This is the input argument from the Top3 function:
"a a a b c c d d d d e e e e e
e e e e DDD ddd DdD: ddd ddd aa aA Aa, bb cc cC e e e
//wont won't won't
, e ..
...
' "
This is the error it generates:
Test Failed
Expected is <System.Collections.Generic.List1[System.String]> with 0 elements, actual is <System.Collections.Generic.List1[System.String]> with 1 elements
Values differ at index [0]
Extra: < "'" >
How can you possibly send an empty list if there is clearly multiple frequently used words in the input?
The "Ties may be broken arbitrarily." is broken in C#. The last random test generates error because of it. After like 10 time running the tests, RNG was on my side and I passed the test ... Someone else suggested tie breaker should be alphabetical, which would make a lot more sense imo.
Maybe specify on the "other characters" part a bit more. If the problem wanted me to avoid ANY character outside of the parameters it sure used a poor example and poor test cases.
Hi all! I have some questions about the requirements that have to be met:
What does "Ties may be broken arbitrarily" mean exactly? What are ties in this context and how can they be broken (arbitrarily)? Could you give an example?
In what order should we return words which occur an equal amount of times? / Does the order matter?
It seems like my solution is failing on the random tests (partly?) because substrings of what I assumed to be words already count as words. Does a word not have to be enclosed by whitespaces to be a word? So is e.g. the simple string 'a' already a valid word and would therefore be counted 3 times in the text "a shadow in the dark"?
I apologize for repeating questions which have been asked before by members of the community. Unfortunately, I was not able to find satisfactory answers to those questions. Thanks for your help :)
The test cases should include the '_' character. The random tests include them while the test cases don't. This is important since this is the difference between /W and [a-z].
(I can't find how to remove commenents and forgot to label it properly)
//Apostrophes can appear at the start, middle or end of a word ('abc, abc', 'abc', ab'c are all valid)
Assert.AreEqual(new List { "'abc", "abc'", "'abc'" }, TopWords.Top3("'abc, abc', 'abc', ab'c"));
Ruby, both sample tests and on submit:
Clarifying that ' alone does not count as a word would be nice.
Overall, it was a fun and interesting kata.
Lua translation!
After seeing solution it appears instructions are quite poor and solution matches values like this one : '''won''twon't''' … (!?)
Random test says its faulty and doesn’t provide the value under test, only expected result.
Log:
This is the input argument from the Top3 function:
"a a a b c c d d d d e e e e e
e e e e DDD ddd DdD: ddd ddd aa aA Aa, bb cc cC e e e
//wont won't won't
, e ..
...
' "
This is the error it generates:
Test Failed
Expected is <System.Collections.Generic.List
1[System.String]> with 0 elements, actual is <System.Collections.Generic.List
1[System.String]> with 1 elementsValues differ at index [0]
Extra: < "'" >
How can you possibly send an empty list if there is clearly multiple frequently used words in the input?
The "Ties may be broken arbitrarily." is broken in C#. The last random test generates error because of it. After like 10 time running the tests, RNG was on my side and I passed the test ... Someone else suggested tie breaker should be alphabetical, which would make a lot more sense imo.
Maybe specify on the "other characters" part a bit more. If the problem wanted me to avoid ANY character outside of the parameters it sure used a poor example and poor test cases.
Hi all! I have some questions about the requirements that have to be met:
I apologize for repeating questions which have been asked before by members of the community. Unfortunately, I was not able to find satisfactory answers to those questions. Thanks for your help :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The test cases should include the '_' character. The random tests include them while the test cases don't. This is important since this is the difference between /W and [a-z].
(I can't find how to remove commenents and forgot to label it properly)
Lacks tests for words that begin in apostrophe.
//Apostrophes can appear at the start, middle or end of a word ('abc, abc', 'abc', ab'c are all valid)
Assert.AreEqual(new List { "'abc", "abc'", "'abc'" }, TopWords.Top3("'abc, abc', 'abc', ab'c"));
Scala translation
Loading more items...