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
hi,
tried it on godbolt,
the resulting assembly-code will be the same,
so there's no real difference.
From my point of view it's just a habit to mark
any cast with the available keywords..
even in katas, it just grew into my muscle memory.
Source of the habit might be this: "https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines" (chapter ES.49) some but not all went in our companies codestyle-guide, so i'm just used to it.
What is the difference between this and
return i
?You're duplicating code. Instead of using function odd, you could use !even which give you the same result.
To avoid copying of a std::vector
What's the reason for changing the function signature?
I assumed that we are not allowed to modify the matrices received by parameter (it is very common to pass large types like a matrix by reference to const) but you could use one of them to store the result and return that instead of allocating a new one.
Do I really need to allocate memory for output and row vectors?