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.
This comment is hidden because it contains spoiler information about the solution
I could have made the type
Iterable
instead ofArray
, but it's too late now.Could have made the type
Iterable
instead ofArray
but it's too late now.I haven't simplified the formula very much, but this is basically my mental model of how it works.
The case expression also makes for stylish Erlang =D
For the record, Erlang arrays aren't implemented as C-style arrays, but are a different (and purely functional!) data structure. Your basic operations aren't exactly O(N), either:
https://stackoverflow.com/questions/16447921/arrays-implementation-in-erlang
Same!
I'd forgotten that CodeWars doesn't trim trailing empty lines.
Don't be a hater! Upvote if you like the code, regardless of my fail in submitting!
Nice work! Approved.
Well done, sir, you've passed the coding interview. Now, tell us what sort of compensation you were expecting while we prepare your office for you 😂😂😂
You can copy the url and paste it (add
/train
at the end) in a tab where you're logged off ....
Didn't mean to choose the same name for my package alias and my argument to reverse, but oh well! xD
IKR
This comment is hidden because it contains spoiler information about the solution
I used recursive groups.
Check my Haskell solution to see how I did it, and pass me an upvote if you like my style (I don't have many!)
(...Hey, I might be able to do it even better in a language which has all the latest PCRE features—maybe I'll try and solve it for some other languages!)
Loading more items...