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.
Nice asymptotics.
I love that it's concise and clear. I don't know if I'd give it Best Practices though, as it's quadratic, whereas an n Log(n) solution isn't too much harder.
I don't think you need to worry about the general case for this problem. In fact, I don't think you even can implement foldr for the general
Foldable a
. You need to know the value constructors for your foldable typet a
, so that you can pattern match against them when you go to write your specificFoldable a
instance fort a
.I like your approach, because it's straightforward functional style. Very idiomatic for Haskell.
I'm just surprised because I've been having a lot of trouble getting the straightforward approaches to finish in under 6 seconds, not just in this kata, but in lots of kata. I'm probably just bad :-p
I'm surprised this completes within the 6-second limit.
I think you might be hitting the maximum precision of doubles on that one. I think I remember that one giving me trouble, too.
Clever, but doesn't work for very close points.