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.
It seems to be. Thanks!
Fixed (along with C translation warning) in this fork. Please approve.
Rust translation
Of course I need it, just search how it is used in floodfill and think of what happens if this check is skipped.
Very fine! But note you needn't pass 'cols' to floodfill (2D C arrays only need the number of columns to calculate correct the array offset).
Well, exactly this is the case when &Vec<Vec<>> is better. I've started with
but then decided not to overcomplicate the code. We have a matrix type here, represented with Vec<Vec<>>, not an arbitrary slice of Vecs.
Also, there's nothing wrong with negatives in matrix, they should be allowed, but I don't see any actual reason to test them.
Oh, about that (I guess we're getting nitpicky): you never use negative numbers, so the type should probably be a
u32
instead ofi32
. Also, I believe it's good form to use&[&Vec...]
instead of&Vec<Vec...>
as the parameter type, though that is obviously more for real world applications instead of kata, where the type is always aVec
.Added better diagnostic messages.
Fixed the incorrect function definition in solution setup.
Your assertions need proper messages to communicate to the user what the input and what their output was. You can refer to the tests in this kata for a comprehensive breakdown of recommended authoring practices in Rust.
I see you've authored a few Rust translations; may I suggest that you go back and apply this fix to all of them?
On a different note, the description is terribly JS/Python-centric, and could benefit from being made language agnostic (or by structuring properly with language blocks). Maybe you'd like to take that on as part of this translation.
Description should be language-agnostic
fixed there
approved
Fixed
missing
in initial code, tests and solution
Approved
Loading more items...