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 agree, it is a very inefficient solution. I authored it purely as a one-liner that didn't need any imports.
This has poor performance for the sake of being on one line. It repeatedly scans the input array when building the counts (once for each unique element in the input array) instead of doing a single pass.