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.
Doesn't work with [23,12,56,2,80], should be [56,80]
not so good.
Because your solution are not readable
and this is the main thing
Not so good.
Because sort giving O(n) log n complexity of the algorithm.
You can solve it with linear complexity.
For exemple:
function twoOldestAges(ages){
var max = 0;
var secMax = 0;
}
It's the optimal way of solving this kata.