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.
Your solution has worse time complexity than needed. Your function is performing more operations than needed and so consumes more time.
You have loops inside loops (yes, includes, indexOf and splice have loops inside), that won't work with long strings.
I dont understand what you mean
Your solution is not optimal.
Not a kata issue.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Ok! I will try that. It passes the example test, it doesnt pass the rest...
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.
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)
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.
Can someone send the tests? Please