Ad
  • Custom User Avatar

    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.

  • Default User Avatar
    1. Issue tag is for the issues with a kata, such as broken test cases, incorrect descriptions etc. Next time please post a Question.
    2. Without you posting your code with a spoiler flag, it is a guesswork to try to help you. Looking how there is no performance tag and my first naive solution passed in 2500 ms, my guess is you got infinite loop somewhere in your code.