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.
isnt sort supposed to be time consuming? instead of just a single pass you are doing an nlogn operation just for sorting
You should stop once you witness failure of monotonicity, e.g. don't traverse the whole array if heights[0] > heights[1]. That way your average complexity will be even better than linear.
Absolutely, you don't happen to know the Big O time for comparing do you?
Nice. Your solution uses methods I wasn't familiar with (total beginner)