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.
Impossibly difficult IQ challenge == 20000000000000000000000000000
added to Ruby
i added a bunch of fixed tests to C#
The top answer for the C# solution is wrong unfortunately, so the tests aren't catching it too!
that was nice
C++ Translation
Thank you for the help.
That test is the last example in the description, and it says there that 0 should be returned, -1 should only be returned when there is no index where the array is balanced.
@Chrono79 You make a good point lol, I had forgotten to delete that from testing. Sorry about the flame in the other post. Btw, I am getting "expected 0" and failing because i am returning -1(as was said to do in the description), whats going on there?
You're not printing the input there, there is no such test. Not a kata issue. Your code fails this sample test for example:
C++ issue;
Test 1: given the vector 3, 1, 0, 3, 0. Expected result is 0, actual result is -1 (+1 on my machine). This is blatantly wrong.
Test 2: given a vector with a lot of zeros which I will not bother typing. Expected result is 9 (blatantly wrong), I have not tested this on my machine but looking at test 1 is enough for me.
This comment is hidden because it contains spoiler information about the solution
Fixing your code, it fails the last example in the description. Not a kata issue.
It prints that -1 is the wrong answer, and says that the correct answer is +0.
And how to solve this?
the warning is gone now. Re-publishing the language version usually solves it
Loading more items...