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.
yeah it is inefficient (and unreadable). Just wanted to make it weird
thanks a lot! :)
why transform all characters even if they are in final form ('c')? No sense
Instead custom lambda, you can use predefined std::multiplies()
any benefit from using auto && in this case?
with iteration from 1 to n you can save n-times on adding i+1
std::map dict should be const, also as mentioned std::vector v is redundant versus map keys
There is missing test at least for C++ that includes {INT_MAX, INT_MAX, INT_MAX, INT_MAX}
Its exotic case but possible and curretly code that overflows to -2 is passing
4 times only if e != w - short circuit of logical phrases in c++, but I agree it is not efficient
I suggest to exchange order on logic expression pred(*itr) && itr != arr.end().
In your variant program first will evaluate pred(*itr) that can be already == arr.end(), what means that you will calculate value for out of container data. In reversed version first will be evaluated that end of container was reached - it will give false and rest of AND conditions will be not evaluated due to so called shortcircuit of operator
What if n is negative?