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.
No, they are not. I was looking to create a square shape, but it wants a square number instead. EDIT: description updated
omfg i did't even thought about it, its so obvious...
Please, mark your post as having spoiler content next time.
This comment is hidden because it contains spoiler information about the solution
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.
filter
won't sort the resulting array.filter tends to sort the resulting array which according to the instruction is not allowed.
They really are, though
The description and the examples aren't good enough.
actually not...
This comment is hidden because it contains spoiler information about the solution
To make the soulution shorter.