Ad
  • Custom User Avatar

    I never would have figured that out. Thanks!

  • Custom User Avatar

    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).

  • Custom User Avatar

    " 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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Super helpful. Thanks very much!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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?

  • Custom User Avatar

    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?