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.
noooo, it's substraction, he wants to control the size of the sum..
because when 3 int params are given, they must be in the correct range, so subtraction of any two of them will not cause a overflow.
That should be some kind of tech worthy to remember.
On my Core i7-4770K best performance is obviously using popcnt instruction, but this one is the next best. The most recommended solution with bitset has the worst performance so far.
CPU clocks per item calculated:
popcnt 2.7
parallel bits counting 6.2
lookup table 11.0
std::bitset 16.3
googled this one after seeing people use bitset, wondered its performance...
interestingly it pretty much compiles down to something that uses Hamming Distance,thats a new one to me
they don't test for underflow but overflow, seems a bit unfair.
I had similar, not sure why people insist on the string conversions