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.
You could make it both faster and shorter by using the walrus operator (see my solution for example).
That is mainly at the lower end. On my PC, a family size of around 1200-1500 minmax starts to be the faster of the two.
For this particular application, the sort followed by direct accesses would be the better choice. I would expect the size of some families to be at most in the hundreds in extreme cases, so this really isn't best practice.
This comment is hidden because it contains spoiler information about the solution
Maybe it's just a case of a novice making assumptions. A O(n log n) followed by four O(1) lookups "seems" faster than four O(n) min/max calls, but in practice it's slower.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I did this too... But I'm not sure it was the intended solution.
I used this way too =)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Simple as
Yeah, that's what I think
Still O(n). Of course, saving max and min results will make it twice faster.
Loading more items...