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.
Fixed
I never knew there was a min function on iter, so short and clever
This comment is hidden because it contains spoiler information about the solution
I forgot about iterators on the array. I need to stop thinking of Rust arrays as C style arrays. I converted my array to a vec first but essentially my solution was the same.
I like this solution alot, I thought some thing like this was possible, but my Rust-foo is not strong enough and I have a hard time navigating the documentation to dig up the idiomatic Rust examples
Well, the
random_tests
actually sometimes include input that is <= 2!Thus the statement
N will be greater than 2
is incorrect!E.g. this code in Rust:
sometimes does not pass the
random_tests
and says:See my other solution, it is better