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.
modulo operation was expensive isn't it? it can be done without using module operation at all..
This comment is hidden because it contains spoiler information about the solution
you can see his solution... there you will see why
impressive!
well it's an
O(n)
solution and there is an obviousO(1)
solutionthat's why it does not deserve its insane 250 upvotes
The values passed to the gen_range method are invalid. You must instead specify a range and it'll work, like so :
rng.gen_range(-2..10)
Put tests in tests module
Nice catch!
Fixed missing borrows from sample tests
Placed tests to tests module
It worked without forking, but I didn't notice that the sample tests use
vec!
instead of&vec!
, so now it should be forked.I did a sneaky edit. Do I fork once again or does it work now?
Try reselecting the version.
Renamed arr to slice
Calling something else than an array
arr
looks strange.Changed from
&Vec<u32>
to&[u32]
Loading more items...