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.
Of course! That makes sense and I should have saw that. The random tests would use the same input to validate. Static tests would know what output to expect.
Thanks.
Since you fail the random tests I strongly suppose that you modify the given input (for example you reverse it in place) and so the reference solution for the random tests doesn't work on the "good" array. Work on a copy of the given input. Cheers.
Given almost all posts about getting timeout are marked as having spoilers because they have, and the same answers are repeated over and over, read this if that's your case:
Your code's time complexity is O(n2) and that won't work here. You code's time complexity should be O(n) to pass. Try googling
"Big O notation"
(it's a long subject to explain it here properly), your code should work in linear time, so if your code use nested loops or a loop and a loop-alike method inside try another way.This comment is hidden because it contains spoiler information about the solution