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.
Quite possibly an
it
-block consists of100
tests, but as soon as the first test fails, the rest isn't even run, just the whole block is failed.So returning one incorrect answer would satisfy ( with a
fail
) the whole block, in 1/100th of the time.That might account for failing in time, but timing out when trying for real.
I've noticed the same. But then I saw it's just buffer overload causes stop of execution.
Language: Python
Skill level: Absolute beginner
Thought I'd come up with a pretty good (by my standards) solution to this one, but when I run it, it times out. No problem, inefficient code is my bet.
However, by purposely causing it to fail (simply leaving out the final integer to the array/list each time) it's essentially "passing" (or, would be) fairly consistently at around 2000ms, +/- 200ms.
Now I don't know the specifics of how execution time works, but it doesn't seem right to me that this last digit in each array can be slowing the whole thing down by five times or more... Can it?
Leaving out the final two integers instead of just the one doesn't seem to make it run any faster (on average, due to random tests), and some of these arrays have thousands of integers in them, so that kinda rules out some kind of exponential error/loop, right?
I know it's something wildly obvious that I'm missing, but if anybody has the time to explain what I'm doing wrong I'd really appreciate it. I'll post some lightly commentated code below if anybody is interested in helping.