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.
I should have used
n
instead of_
, but I'm just a bit baffled by how to handle all of Rust's explicit type conversions in general, while keeping the code concise! Need a lot of practice here!After writing this, I learnt about
scan
,Wrapping
, and notation like0u8
, which allow for a more elegant and Rustacular way to write this solution.This is a good solution.
The kata creator said that this is going to be a series, and so the code warrior created an interpreter that is fully and easily upgradeable to handling a fully-fledged language.
The safety of Rust and the rigour of the compiler will make completing further challenges a doddle. While I, on the other hand, will need to rewrite my code :)
haha
compare these languages by sorting the following array
[0, -2, 1, 2, -1]
ðĪŠ,*sounds of hating js*
but the meme is funny
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 ....
Loading more items...