Ad
  • Custom User Avatar

    You should minimize your code time complexity. Or if that is not possible (any more), you should optimize your algorithm to perform less costly operations.

    Hint: your solution should be fully linear, sorting the input array will already make you time-out.


    Also, I've updated the tests, so you'll have to reset your trainer, reload the page, and... reset the trainer again. Save your code before doing that (Ctrl+C) as everything will be cleared and restored to defaults (alternatively, after doing these operations you can click onto the trainer and press Ctrl+Z, as clearing the editor window through reset is a reversible operation).

  • Custom User Avatar

    your code: you have to think about a more efficient algorithm.

  • Custom User Avatar

    I have to agree with this.