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.
nice
While there is no
performance
, the input constraints are mentioned in description. With 10^5 input, the expected time complexity should be less than O(n^2). Your code looks to have O(n^2) because of operations like.splice
or.indexOf
nested in a loop.However, there was an issue raised about it below and seemingly O(n^2) should be accepted now? Maybe there are some inconsistencies between tests of different languages, that's up to the author to clarify.
Issue
tag is for the issues with a kata, such as broken test cases, incorrect descriptions etc. Next time please post aQuestion
.spoiler
flag, it is a guesswork to try to help you. Looking how there is noperformance
tag and my first naive solution passed in 2500 ms, my guess is you got infinite loop somewhere in your code.Help Execution Timed Out (12000 ms)