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.
Quickselect has O(n**2) in the worst case though. Just iterating over the list and setting the two biggest like in my solution would be optimal in runtime
Does it get faster if you put the x right into the place of self? Or is the 'self' function optimized away?
This is awesome! My solution is O(n) too but yours is abolutely concise and elegant!
This comment is hidden because it contains spoiler information about the solution
#cathax
Nice catch, I just got rid of it.
It's the last of the fixed tests, not the random ones: it has an extra space at the end of the second line.
Thanks, I'm glad someone found this kata useful :D
I just took a look at the random tests, and the rows are all working properly. Hmm...
This comment is hidden because it contains spoiler information about the solution
grouping is pretty usual to "spell" the numbers in pairs
This one was hard because I think I'm not quite grasping the math involved. I got something I'm happy with visually - but I can't quite understand what the shorter, better solutions are doing.
For some reason this passed the tests but shouldn't have: it started taking the fibs at 0, 1, 1, 2... instead of 1, 1, 2, 3...
Of the non-valid examples, why is "(56) 84 6 552" not valid?