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.
The expected and actual were switched in the test, so although the test cases worked ok, the test output looked awkward.
Will be nice to use generics when 1.18 is supported.
@Joel according to the rules, new words are defined as starting after any space, comma, exclamation point or period. Additionally, there can be multiple spaces between words, and if so, the number of spaces should be preserved.
I like the overall solution, but I don't like how it converts the alphabet to uppercase so many times. Assign it as a var?
https://www.w3schools.com/css/css_pseudo_elements.asp
Note: As a rule, double colons (::) should be used instead of a single colon (:). This distinguishes pseudo-classes from pseudo-elements. However, since this distinction was not present in older versions of the W3C spec, most browsers support both syntaxes for the original pseudo-elements.
Although my comment above focuses on the negative, personally, I think that this is a good kata because it gives a real-world situation for doing the dot product. There are many ways to do a dot product, so it gives us practice thinking about it.
As it is, some people are challenged not by the underlying problem itself, but by the description of the problem. I like that example, @Chrono79, and think that it could strengthen the description.
Alternately, you could just write it out in words.
[0 0 0 0 0 1] means that Good has one Wizard. One Wizard is worth 10, so Good's total army is worth 10. [0 0 0 1 1 1 0] for Evil means that there is 1 Goblin, 1 Uruk Hai and 1 Troll. A Goblin is worth 2, Uruk Hai 3 and a Troll is 5, so Evil's army is worth 10. The result of this battle is a tie!
Maybe it's just "Evil", not bad!
This comment is hidden because it contains spoiler information about the solution
To be honest, this is the reason I don't recommend codewars. It's got a fairly low quality of kata, and people refuse to use the mechanisms like voting that could lead to better ones. Then they are pedantic when anyone insults the poor quality. We shouldn't waste much time on poor quality systems when there are plenty of better competitors.
It wasn't 8kyu. You are bringing up irrelevant details?
Some people think it was stupid. Therefore it is stupid in some ways. It is stupid to say that "it is not stupid at all". The degree of intelligence is not a binary choice.
Note that the description also states that j is to be as small as possible. Now, I don't know about you, but in my opinion, 0 is a smaller value for j than 1.
I sincerely hope that we can downvote more often. It is not "well-documented" when a major stipulation is mentioned in less than 1% of the description. When 85% up-vote a kata but 30% of the comments are complaining about it, there is a disconnect.
Have you looked at the dozens of comments from other people? It was not "well documented" that the order in which the indices are selected is relevant for any smart reason. Inserting some stupid criteria like "i as small as possible" is clearly an irrelevant detail if dozens of people pointed it out. This issue is actually around 30% of the problem but less than 1% of the description. That is my definition of "stupidity".
Furthermore I am obviously not talking to you, who seems to be completely satisfied with the kata.
I clearly stated "when there are obvious stupidities". Stupidities are of course subjective. So if you don't think there are stupidities, and you feel like wading your way through subjective orderings of indices, then you should not feel miffed by my response.
Why did so many people up-vote this Kata when many of the test cases demand an arbitrary ordering of index values that are irrelevant to the solution?
Ex: 206617 answer is [26617, 0, 1] but [26617, 1, 0] is the exact same thing and is marked incorrect.
Please down-vote Kata when there are obvious stupidities. I don't always want to waste time on poor specification, and when I do, I would like to access poorly specified problems via the "vote" system.
The first test is wrong, it should be
testing(209917, "[29917, 1, 0]");
because the'0'
at position i=1 is moved to the position j=0, makeing029917
which becomes29917
. In my experience, it is incorrect in the example test cases but correct in the final test cases.The second test seems right to me. The zero at position i=3 is moved to position j=0, making
026945
, which is26945
.It seems that you have not changed a single logical operation. I mean, why would you say it's really useless code if you keep it, but just changed my two 'if' statements into a single 'if' by using 'or'?
To be fair, your version may be more readable. I just dispute that there was useless code (except I didn't bother to remove the print statements, which is debug info).
Loading more items...