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.
Can you (someone) elaborate? How is this inefficient? (Lets say the compiler optimizations are on.)
Is it possible to write
let divide = (n / 9) as usize;
instead? (using integer division)
Why own definition of reverse?
This comment is hidden because it contains spoiler information about the solution
Interesting solution. Can someone explain how performant this is, i.e. how the short-circuiting here works, i.e. what happens when length of xs is smaller than n?
I already learned through this solution, that pattern matches are allowed to fail in some monads (like list and Maybe) :D
sort is not needed.
Nice solution! It generates a lazy output. However shadowing the variable x is not my taste. Should be y or something.
Nice Solution.
But: Output list is not generated lazily. :)
Concatenating a single element to the right needs O(n) time. Same with filtering the accumulatior. So overall complexity is O(n²).
Otherwise good solution.
Very clever!
Nowadays head and tail also support printing a stack/sensible error messages on failure. But you're right that toCamelCase should support empty string as input.
What I like about this solution is that it defines custum data types. What I don't like about the solution is its often very short variable and function names. When it isn't meaningful to introduce a new variable/function one can often do the computation(?) in place, like inserting a case .. of or a lambda (case) instead of a new function. E.g.:
exec cmd regs = case cmd of
Mov a b -> ...
Inc a -> ...
where
...
Also in simpleAssembler sz does't change, so it doesn't need to be an argument of go
Looks very nice. Can someone explain for me how/why this solution works?
Can someone explain to me, why this works?
This comment is hidden because it contains spoiler information about the solution
Loading more items...