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.
That is a valid solution. The Python translation has been updated accordingly, thanks.
I suggest reducing the number of hacks to minimum and make sure that your basic k-means algorithm handles short tests well.
When this kata was created, scipy was not available here on CodeWars, so there was no "usual implementation", so the original solution has k-means implementation of its own, and it was a kind of a point.
Maybe it's worth quoting the kata description: "if you have trouble discerning if the particular sequence of 1's is a dot or a dash, assume it's a dot".