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.
Your solution is quite a bit slower than this one actually ;)
Benchmarking on the same input, this solution provides:
Ops/s: 5,122,611
Yours is:
Ops/s: 740,402
thank you ^w^
This is a clever solution!
Thanks!
This comment is hidden because it contains spoiler information about the solution
See above, sorry it isn't the best explanation but I hope it helps. (Also, sorry for a late response, replies marked as spoilers do not appear as notifications)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Wouldn't this be O(nlogn) since every is only iterating over the elements to the right of e?
How do you find the Time complexity of functions like filter and slice. is there a website for this?
@Unnamed. Looks like this kata is no match for your smarts
Thank you. The analogy to a checkerboard opend my eyes.
This comment is hidden because it contains spoiler information about the solution
You could solve it without sorting the array thus this problem is solvable in O(n).
This comment is hidden because it contains spoiler information about the solution
Loading more items...