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.
I did the same.
This solution has O(n) complexity, while the others (based on sort) has at least O(n log n) and heavely depends on sort implementation.
I like this soultion because it's probably longer than it should be. Like mine.
And that, my friend, deserves respect.
This comment is hidden because it contains spoiler information about the solution
This is because first two items are checked before the for loop
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution