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 can be solved in O(log n). Is this needed or is a simple O(n * log n) brute force sufficient? I mean, information to figure out which of them is desired is missing from the question and the latter is barely interesting
what the heck kind of restriction is that?! How is one solution "better" than the other if it has the same asymptotic complexity, same code length and same real-world performance. That's just arbitrary.