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.
to be clear, this is not the best solution as it uses O(n^2 log n) time; Blind4Basics solution is better.
Thanks for suggestion.
nice, could use some spaces for cleanliness tho.
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
It looks like the unused variable
_
only exists to cause it to be initialized with the result of_write_t_buf
etc. as a way to execute those functions in thefor
loop setup. It seems kind of hacky, and I made it be quiet in a similarly hacky way, byturningburying that unneeded return value in the0
we actually needed earlier:well, it SeemsToWork™
I think I have fixed this now
Random test in C produces some garbage like
looks ok
Loading more items...