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.
Yep, came to post the same thing.
This is better than the current top-voted solution. Many people using (numbersCount < 2), but they are just executing a for loop they don't have to in the case of numbersCount = 2.
My code was very similar, but you can return 0 with numbersCount < 3, which would save you from executing a for loop unnecessarily on the case numbersCount = 2...
This Kata makes me hate English
Yes, using Counter like you did is better. Or counting yourself with a dict and a single pass through the array.
Is better complexity possible?
This comment is hidden because it contains spoiler information about the solution