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 think you need both. You need randomised tests that will get you to cornercases. You also need fixed tests, i.e., every random test that ever failed, should be made into a fixed test. Then you are certain to avoid regressions, while still exploring the complete spectrum on every test run.
This comment is hidden because it contains spoiler information about the solution
You import sortBy, yet you do not use it, instead opting for the more expensive reverse after the sort.
I think this will walk the first k elements twice. Once to take i elements off the list and once to compute last.