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.
I have reduced the random tests to 50, and even that may be too many.
Asking for microoptimisations is beyond the realm of
5
kyu.This is O(n^3) but most other solutions I saw are O(n!)
That is correct. My Solution in structure has the same flaw. Even a bit worse.
I definitely have a O(n) solution here and have a highscore of 72 in the performance test by even replacing Math.min/max by if-then-else, removing any form of readablity-feature from the I got there from 21. The performance ist not about the complexity of the algorithm but JavaScript fine-tuning. Sad. This could have been a nice Kata.
P.S.: Even from a Sample of four provided solutions I took, three reliably ran into timeout.
This comment is hidden because it contains spoiler information about the solution