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 is pass-by-value since the & was removed. So the input parameters are in fact copies. The code is fuly eqivalent to the function taking const& and then making explicit copies.
It is called a fold expression
I removed also the
&
to take a copy of the inputs. So from the callers perspective the signature is effectively the same.Well, your solution has the same time-compelxity (unless
s2
is much smaller thans1
) but much worse chache-locality due to the use ofstd::multiset
which is a node based structure.This comment is hidden because it contains spoiler information about the solution
The kata description says: "The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits."
This comment is hidden because it contains spoiler information about the solution
I've got the advice to never move in a return statement from Scott Meyer's 'Effective Modern C++'
It is a local variable since you are copy-constructing it.
It's a premature pessimization to move in a return statement. It prevents named return value optimization (NRVO). If NRVO were note possible the value would be moved either way since it is a so-called expiring lvalue.
So if you write
return str
the returned value will be either moved to its destination if NRVO is not supported or else the move will be elided away.rust translation, please review and approve.
This comment is hidden because it contains spoiler information about the solution
You are not allowed to use functions to solve this kata. The purpose is to train template metaprogramming.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...