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 love rust, it's like diamond
Oh lovely, I didn't know you could do that with
=n
to make it inclusive.incredible! You make it looks so easy! I suffered much because I din't know this chain and step_by.
still O(n) tho
Wow this is incredible and so beautiful. I love this!
Good!
lovin the cleanliness.
You could use
.unwrap_or(0)
rather than pattern matching.@lvsz
map
andsum
should fuse into one fold. but your solution is more explicit in this.That's still two passes, you ought to use
foldl
tomap
&sum
concurrently in a single pass.Just press 'View Solution' under my comment.
How do you do it without two passes?
Amazing!!
This comment is hidden because it contains spoiler information about the solution
Two passes. Bad.
Loading more items...