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.
Did you bench it. It looks that hashset is not required or is slower that this solution. Probable because L3 cache
thanks
This comment is hidden because it contains spoiler information about the solution
Sorry, but which part of "adhoc method" did you just miss? :P
You can either solve this problem with math formula or using adhoc method.
For math formula, you can see solution of g964, which is the most clever.
My solution is for adhoc method.
And since raw loop is hard to follow, so code without raw loop is better practices, hence the votes here.