Ad
  • Custom User Avatar

    Your solution has worse time complexity than needed. Your function is performing more operations than needed and so consumes more time.

  • Custom User Avatar

    You have loops inside loops (yes, includes, indexOf and splice have loops inside), that won't work with long strings.

  • Custom User Avatar

    I dont understand what you mean

  • Custom User Avatar

    Your solution is not optimal.

    Not a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Ok! I will try that. It passes the example test, it doesnt pass the rest...

  • Custom User Avatar

    You can print stuff to stdout and they will show up in the test output as 'log' boxes.

    You might want to print out the lengths of the input strings to see if the timeout was caused by your algorithms not being able to handle such large inputs.

    If inputs of comparable lengths work without a problem when you try then it might have hit a infinite/very long loop condition in your algorithm. Either print and grab the input if it's not too long to print, or try generating inputs yourself.

    In any case, the 'passing all tests' is inaccurate in the case of a timeout, because the rest of the tests are not even run.

  • Custom User Avatar

    Why my test run out of time? I have tried it in different IDES and it passes super quick but not here. It passes all the test but then it gives me an error.

    Exit Code: 1

    STDERR
    Execution Timed Out (12000 ms)

  • Custom User Avatar

    In early days TDD was seen as a good practice. Only with years the absence of sample tests became an example of bad kata design.

  • Custom User Avatar

    Can someone send the tests? Please