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 comment is hidden because it contains spoiler information about the solution
if the author came from haskel that's the natural way of using functions...
This solution has a run time of O(n). Since the run time of a sorting algorithm is usually O(nlogn), and you'd still have to iterate through your array once more to count the number of times the integer appears, this solution would be faster.
This comment is hidden because it contains spoiler information about the solution
They were ranked ages ago when the ranking system was based on the task at hand instead of how fast someone solved the kata, now the standard has dropped dramtically because multiple people can approve katas instead of the one person like before.
Never thought about doing it backwards, to be honest. Clever!
Unfortunately, I can't add more test cases after the kata has been published. (Wish I could, it was published before all the languages had been properly filled with tests cases.)
Thanks for pointing it out.
Now I will spend the day trying to come up with a real sentence that will catch this kind of code in both directions. :-)