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.
This comment is hidden because it contains spoiler information about the solution
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.