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.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/151.
Please join the discussion to help us identify duplicate kata and retire them.
The example solution and the reference solution modify their input. That means in the random tests, the input will always be sorted already. In this case, that's not disastrous, but it's a bad habit to get into, because one day it might bite you subtly, but hard and painful. Therefore, do not teach this to solvers either. Test for input modification, and fail them if they do.
For this reason, somewhat satisfied.