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.
I never would have figured that out. Thanks!
I'm new to this, so I could be wrong. I just mean that I wrote some code that passed all the tests. But that code assumes that the slice between parameters a and b does not occur somewhere before a. When I checked my code against ('socratessocrates', 8, 10), it failed because it returned 'cosratessocrates'. The same point can be made with ('abcabc', 3, 5).
" Your task is to reverse the portion of that string between those two indexes inclusive"
I can write a code that passses your tests and fails to reverse the portion of 'socratessocrates' between 8 and 10 inclusive.
This comment is hidden because it contains spoiler information about the solution
The tests don't test for an outlier: repeating strings. For example, solve('socratessocrates', 8, 10);
It's easy to replace 'soc' with 'cos', but it's a bit more tricky to replace the instance of 'soc' between 8 and 10.
Super helpful. Thanks very much!
This comment is hidden because it contains spoiler information about the solution
Also, I'm getting and error, 'Process exited prematurely with a SIGKILL signal', even though my code passes all the tests. The result is I can't submit. Anyone else have this problem?
Is it just me, or is codewars sometimes buggy? Sometimes my functions return undefined, then I try the exact same thing later, and it works! Does anyone else have this experience, or am I crazy?