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.
This comment is hidden because it contains spoiler information about the solution
You need to consider that this scenario/position might not be possible at all because too many people would stand behind him in that case!
Because in such case, exception does not originate from inside of
str
. It's raised beforestr
is executed.That's the idea. Most of these Katas are 7 Kyu and can be solved easily in some languages. For instance, this Kata is trivial in Python, Ruby and Haskell. It's much more difficult in Java, cpp, JS, and others that don't have in-built cartesian product methods because you must use two nested loops correctly.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
[-10, 10] should return -1. You start at index 0, and here the left sum is 0 and right sum is 10. Next, index is 1, and here left sum is -10 and right sum is zero. You never go to index 2 (where the left sum would equal the right sum), since index 2 is not an index in the array.
This comment is hidden because it contains spoiler information about the solution
There's an implicit loop; the complexity is the same.
The log appears above the test result, you're confusing the expected value of one test with the input value of the next one, the test with that input expects
"YES"
.This comment is hidden because it contains spoiler information about the solution
Not an issue, the first value is what your function returned, not the input value, for the first one, the input was
"foobar99"
. If you want to see the input value, print it, it'll appear above the test result.Read the description carefully, print the input and see what happens.
Timing out is not an issue.