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.
you would be surprised to know that it's actually slower
conversion to set takes some time and set() is called in every iteration.
This comment is hidden because it contains spoiler information about the solution
Agree with above. The average time complexity of determining if something is in a set is constant which brings the overall time complexity to O(a + b) instead of O(ab)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
If b is large enough, it is indeed the best performant.
Sorry about that!
Please use a spoiler flag, comments are visible to everyone by default.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
normally efficiency. But here, it's done in a pretty stupid way, which makes this solution even slower than the O(n²) solution without the set... XD
=> See the fork.
Loading more items...