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 love this solution
Pretty, kind of clever, but not the cleverest nor very performant. Why iterate twice when you can have a single for loop?
Instead of one run in search of the maximum and minimum , it is run twice here.
This comment is hidden because it contains spoiler information about the solution
Because sorting the array once is slower than iterating through it twice.
Why not sort the array once and then take the last and first elements?