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.
This comment is hidden because it contains spoiler information about the solution
One suggestion I have is to start off by initializing
return_vector
likeVec::with_capacity(height * (height + 1) / 2)
. This way, you can avoid unnecessary allocations. From what I gather, in your situation, Rust reallocates with everypush()
operation you perform.I've been checking out other solutions, and yours seems to be the most concise. Thanks!
But this solution does not account for negative values... 🤔
Most readable solution! Good code.
That's actually kinda fun. Thanks for this example.
What
<=
means? Never seen it before.Hm. Good solution.