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.
While this works,
push_back
in a loop results in unnecessary allocations as the vector expands, you shouldreserve
the result vector first.How can an O(n)^2 solution be considered a 'best practice'?
Yep that check every time is really unnecessary.
This comment is hidden because it contains spoiler information about the solution
creative solution :-)
its a c++17 feature, so is more efficient. eg for larger vector sizes. It can run both accumulation and reduction in parrallel meaning its optimized for multicore systems. Although for this eg the differences are miniscule.
This comment is hidden because it contains spoiler information about the solution
neither clever nor good. o(n^2).
Simply... EXCELLENT
simple and persice, I like it
Negating 'a' is the Best Genius Way to get the alternating sum... !!!
Congrats
Should not std::move() a result, RVO does it for you ?
The instruction should be made more clear
wow
Should be fixed now. Thanks!
Loading more items...