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.
translations should try to be idiomatic and use the datatypes/techniques that are usual in their language. output parameters and programming by mutation are much more common in C than in other (higher-level) languages
your code contains undefined behavior, your
while
loop will happily iterate past the end of the array and overwrite arbitrary memoryI solved this kata in C and Rust, and I have a question. Why does the function in C mutate the array in place, but in Rust it requires to create a new vector? In Rust, we can use mutable slice to change data in place as well:
fn move_zeros(arr: &mut [u8]) { todo!() }
It seems that this is the only one solution that does not use temporary memory allocations, isn't it?