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.
Can't really understand the description for this one, {1,2,3,4,3,2,1} yeah s ure, 4 is the sum of both the left side and right side of the array.
Then this {1,100,50,-51,1,1} the sum result of 50, -51, 1, 1 is the same as the first position in the array which is 1, sure ok.
But now this part just makes me feel dumb:
"You are given the array {20,10,-80,10,10,15,35}
At index 0 the left side is {}
The right side is {10,-80,10,10,15,35}
They both are equal to 0 when added. (Empty arrays are equal to 0 in this problem)
Index 0 is the place where the left side and right side are equal."
The left side is empty? And Index 0 is the place where the left side and right side are equal? Whaaat?!
C++ Translation
Chai + assert for CoffeeScript
I have an issue in c++ code, in this test
vector numbers { 1,100,50,-51,1,1 };
In my IDE output is: 1, but in code wars i have output -1.
This is my code
int find_even_index (const std::vector numbers) {
int sum_r = 0;
int sum_l = 0;
for(int i = 0; i < numbers.size(); i++){
for (int l = 0; l < i; l++) {
sum_l += numbers[l];
}
for (long int r = numbers.size(); r > i; r--) {
sum_r += numbers[r];
}
if (sum_l == sum_r) {
return i;
} else sum_l = 0; sum_r = 0;
}
return -1;
}
Please help me find out what is the problem
C translation (author gone)
JS:
Node 18. (
mocha
+chai
) should be enabledfunction name should use
camelCase
Description is quite terrible, with even no answers shown for the examples, and sample code having different examples.
Especially "We need to check ALL of the substrings inside of 877692" is very ambiguous.
Description has "1st position of the array" which is technically incorrect use of English where first indicates no other object comes before it, which in this case is incorrect. Better would be to use "at index 1 of the array" for 0-based arrays. Same for other instances.
This comment is hidden because it contains spoiler information about the solution
I suggest to add this casetest too because the string "ƒoo" contains a non-ASCII character, which may behave differently than ASCII characters in certain operations.
for example the len of
ƒoo
is 4 not 3.Hi guys, I really don't know what to do. The test passes without errors, random selection also passes without errors. But an error occurs in FindEvenIndexTest -> testIt
How to understand it
common symbols
should be defined. They are not the same in different languages.Moreover Python random tests don't even include digits.
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
Loading more items...