Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Test Failed
Expected and actual are both <System.Collections.Generic.List`1[System.String]> with 3 elements
Values differ at index [1]
Expected string length 1 but was 0. Strings differ at index 0.
Expected: "d"
But was: <string.Empty>
-----------^
What is this actually saying?
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
I pass the first tests but when I attempt it fails on this:
[Incorrect match: words not present in the string.]
I am not sure what it means, could anybody give me an example?
The sample tests pass OK but I'm pretty confident as written there's an issue with the randomly generated tests. For the following input:
hKxhqGKw vZbByUFiuiNVvZbNyxueiWFWdOaiO NLBB vZb vZbFqOWNZYjuaEuiNV X'LIQQr MhKQDNZ MlmgKBuNyxu X'LIQQr NyxuX'LIQQr vZb vZb X'LIQQrvZbhKxhqGKw JQilHATveiWFWdOaiOMhKQDNZoDv MlmgKBu MlmgKBu X'LIQQrNyxu uiNVMhKQDNZhKxhqGKw MhKQDNZNyxu uiNVByUFi MhKQDNZ MhKQDNZ hKxhqGKw uiNV MlmgKBuvZb MlmgKBu FqOWNZY oDv uiNVoDv JQilHATv hKxhqGKw ExwqMcPEPLRURVEJQilHATv MhKQDNZ X'LIQQrjuaE JQilHATv MhKQDNZX'LIQQr ByUFi MlmgKBu ByUFiNLBB uiNV uiNVX'LIQQr hKxhqGKwhKxhqGKw FqOWNZY NyxueiWFWdOaiOjuaEuiNVX'LIQQrJQilHATvJQilHATvMlmgKBu X'LIQQrJQilHATv JQilHATv FqOWNZYvZb FqOWNZYByUFi vZbhKxhqGKwNLBBFqOWNZYX'LIQQr Nyxu JQilHATv JQilHATveiWFWdOaiOoDvoDv NyxuuiNVByUFi MhKQDNZJQilHATv eiWFWdOaiO NyxuNyxuuiNV juaE juaENyxuX'LIQQr vZbvZb FqOWNZYeiWFWdOaiOoDvuiNVvZbMhKQDNZjuaEX'LIQQr JQilHATv MlmgKBu JQilHATv ByUFi NyxuNyxu vZb ExwqM MlmgKBu uiNV FqOWNZYhKxhqGKwuiNV MhKQDNZJQilHATv MhKQDNZ uiNVeiWFWdOaiONLBBFqOWNZYuiNVuiNVNyxu vZb vZb MlmgKBu MlmgKBu ByUFi MlmgKBu hKxhqGKw cPEPLRURVE JQilHATvvZbNyxuFqOWNZYMhKQDNZMhKQDNZ NyxuJQilHATvuiNVNyxu oDv JQilHATvvZbuiNV eiWFWdOaiO X'LIQQrX'LIQQrjuaE Nyxu JQilHATv FqOWNZYJQilHATv FqOWNZY FqOWNZYjuaEJQilHATv Nyxu X'LIQQr NLBB X'LIQQrFqOWNZY uiNV uiNVMhKQDNZvZb X'LIQQrvZbByUFijuaE uiNV MlmgKBu vZb vZbuiNV NLBBvZbFqOWNZYvZbX'LIQQr JQilHATvMhKQDNZJQilHATvJQilHATv MlmgKBuuiNV vZbMhKQDNZ X'LIQQr vZb FqOWNZY MlmgKBu X'LIQQr FqOWNZYoDv uiNV MlmgKBuhKxhqGKwvZb vZb JQilHATveiWFWdOaiOJQilHATvByUFi JQilHATvMhKQDNZ uiNV FqOWNZYNyxu ByUFiNyxuMhKQDNZ X'LIQQrvZb X'LIQQrJQilHATvNLBBFqOWNZYX'LIQQrByUFiX'LIQQrhKxhqGKw MhKQDNZByUFi oDvJQilHATv X'LIQQrMlmgKBu MlmgKBu uiNVX'LIQQroDvhKxhqGKw MhKQDNZJQilHATvJQilHATvMlmgKBu Nyxu X'LIQQrMhKQDNZhKxhqGKwX'LIQQr hKxhqGKw eiWFWdOaiO MlmgKBu vZbuiNV FqOWNZY
I get:
Incorrect frequencies expected:<[30, 30, 29]> but was:<[20, 30, 30]>
Looking at my output one of my words with a frequency of 30 above is
vZb
. My program calculates this as occuring 7 times, not 30. The stringvZb
does indeed occur 30 times, but sometimes as a substring of another word. Occuring as a substring doesn't really fit the definition of a word.To illustrate this the introductory example of
In a village of...
has a sample output of["a", "of", "on"]
. Based on the logic the test appears to be followingon
should be in 2nd place as it occurs 8 times toof
's 5 times.It is unclear why one apostrophe "'" or three apostrophes "'''" are not a word if "Apostrophes can appear at the start, middle or end of a word" and a word consists of "letters (A to Z) optionally containing one or more apostrophes". Stating clearly the rule that "a word must contain at least one letter" would improve the description.
It is also unclear from the current description, if a word can contain two adjacent apostrophes.
Aimed for solving this including the "Bonus Points" and ended up with a rather dirty solution that uses a cache for the top3.
(to be honest, I am not even sure how this actually performs against just splitting the string directly and ordering the list in the end...)
Obviously the top solutions are much more elegant, but I wonder if the lazy evaluation in Linq is actually able to fulfill "Avoid sorting the entire array of unique words." ?
Is there any way to do this elegantly while still getting both "Bonus Points"?
Loading more items...