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.
Learned from others:
[]byte
is zero-length slice, notnil
(same forstring
)strings.Builder
P.S. (benchmark on "Hello, World!")
Yes, you are right!
I benchmarked this solution and your solution with
valgrind
, found:cargo build --release
generate_shape(50)
This comment is hidden because it contains spoiler information about the solution
,p+1
is redundant,[p..]
is enoughzipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
After debug, forgot to set
y
@for y in 0..n
to_
.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
f64.powi
is better thanf64.powf
, because:Just Couldn't come up with using
filter
!u8::max_value() == 255
&&b'H' == 72
&&b'8' == 104
.So, no overflow when
cell.bytes().sum::<u8>()
if given validcell
.Didn't realize
sort_by
is a method of ModuleEnumerable
.So, use
str.chars
before.map
is inefficient.learned a lot from this kata!
Loading more items...