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.
@Pamblam, I think he talks about consistency.
It would make more sense for iteration function (callback function) to return a promise instead of accepting a callback argument.
Or, on the other hand, slowLoop could accept a callback instead of returning a promise.
What about async functions?
C++ sample test is broken. Throws errors.
For example:
results in
Did you forget to
#include <cmath>
?Should be fixed now.
This comment is hidden because it contains spoiler information about the solution
I understand the kata's description
in the following way:
So, in the mentioned test:
The pair
[5, 5]
with indexes 1 and 1 violates #1.The pair
[5, 5]
with indexes 1 and 5 violates #2, because[3, 7]
with indexes 3 and 4appears earlier (both values of the
[3, 7]
pair appears before the second5
of the[5, 5]
pair).This test is also explained in the kata's description: see the last example.
Hope that helps.
Nice one :)
Looks like a typo:
I think
should
was supposed to be there instead ofshow
.I think this kata (and other 'Vasya' katas as well) is just copy-paste of http://codeforces.com/problemset/problem/208/A
I don't know if Codewars has any policy about such things, but I personnaly don't like it.
The description should at least have a link to the source.
That's awesome! I like the way it all began with a comment.
I hope no one's feelings are hurt.
Why are you so sure?
Why can't you spend a minute and try to understand what the problem is here?
All your messages are like 'You are wrong. Go away'. That's a good reason to downvote.
Oh, really?
Let's try this solution:
Ah... Seems like something is wrong with my code...
But can you say what?
All what you need to do is to convert a vector of pairs to something what the test framework can handle.
For example, converting it to string should work:
Using
testequal2
instead of yourstestequal
yields the following output:And that's what I would like to see.
I understand why I get that.
The problem is that it's useless.
I expect to see more details on why the results are wrong.
For example Python tests output looks like
Which is a way better.
Zero is not a positive integer.
Tests output for C++ is not very informative:
Could you describe what the problem is exactly with the part 2?
Your solution should work, but it will only work if
data.length
is 32.To complete the kata you will need to generalize the algorithm to handle any length (multiple of 8).
It seems that the idea here is that a solution should be able to sort any array, i.e. object arrays (
Object[]
,String[]
,Integer[]
and so on),int[]
,long[]
,float[]
,double[]
and so on.Loading more items...