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, but I also believe that a solution should only be optimised if it times out.
Funny how this gets best practice upvotes, ugly runtime...
Note that the
in
check is super inefficient with a list (needs to check against all the elements), so this solution is O(words**2).It is better to use a set (or dict if you need values).