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.
It's not a performance kata ( though
qbsort
is definitely a performance algorithm! ), so the solution is valid. But it should not be upvoted, at least not for Best Practice. :]I agree. It feels strange to talk about n log n complexity in the context of BogoSort, but as we are assuming a quantum computation runtime environment, your criticism makes sense. :) Unfortunately I can't revert the solution.
Sorting the list in
O(n log n)
to check if it is sorted, which can be done inO(n)
, is not a Best Practice.( People, please stop upvoting such solutions. )
Random Perl tests produce strings with less than two characters.
Thanks, Johan, I'll try!
I think
++
is killing you ( it'sO(n²)
if recursed into left-associatively ).Could you express the result sequence entirely and directly in terms of itself only, like
fibonacci = 0 : 1 : zipWith (+) fibonacci (tail fibonacci)
?Very cool kata, thanks! My Haskell solution seems to work correctly, but times out with the big test set. Generating 10k entries takes 2-7 seconds on my machine, which is not very satisfying. Currently I have no idea what to improve. :/
You don't like it?
ok but why
yep, that worked. might prevent some downvotes.
dummy issue to force an unpublish for now
Exact duplicate, please retire it.
Are you sure it's retired? https://www.codewars.com/kata/57e5279b7cf1aea5cf000359
I don't know how this passed the tests... Equivalent (point free) versions of it did not.
I'm sorry for your time, but I'm also glad you liked it. :)
Loading more items...