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
On one side I feel bad for not figure this kind of solutions out just cuz' I forgot certain lang feature exists, on the other side I love checking them out to see how they work.
But hey, practice makes perfect
what a beautiful solution!
Vector: so good, ya gotta include it twice! :)
tysm, this helped alot!
For even more improve performance, change
n.second % 2 != 0
ton.second & 1
.This comment is hidden because it contains spoiler information about the solution
If you click in the 'Output' section (next to 'Instructions') you can find the time your code took on the top left hand corner above 'Test Results:'.
Hello. Where can I see the speed of code to compare solutions?
Good solution, but there's no need to use
const auto&
while iterating on container with builtin types such asint
. It doesn't improve performance but affects readability.This comment is hidden because it contains spoiler information about the solution
This solution is very slow, look at the rock4259 solution, it is an order of magnitude faster. 572 ns and 35 ns respectively.
This comment is hidden because it contains spoiler information about the solution
Thank you!
This type of metaprogramming is definitely more difficult than 4Kyu.
Loading more items...