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.
Ah, good point. If optimization was requred for that kata, I likely would have used set or some other implementation. I saw a few other solutions using the "Counter" data structure to do it all at once. I'm not entirely certain as to the time efficiency difference between the methods, but I'm sure it'd be an improvement.
As I've spend more time here on codewars and programming in general, I've also came to the realization that time efficiency isn't as important as the CS classes make it out to be in most situations. Optimization is rarely a bad thing, but it's frequently not worth the time investment when it's not needed. Especially if it sacrificies the readability or simplicity.
I've found that I get the most out of my time by starting with code that is the most readable and simple, and optimizing it as needed. Your suggestion was a good idea though, since set is a commonly used data structure. I tend to avoid using methods that would over complicate the code when it's not needed. I used to do the opposite and endlessly refactor my code until I felt it was near perfect.
Thanks for the feedback! It's fairly uncommon for people to leave a comment on code solutions (especially the ones that weren't the most upvoted), but I always welcome constructive criticism (: