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.
Isn't it possibly O(n^2) since there are nested loops?
This comment is hidden because it contains spoiler information about the solution
Why is this best practice?
yes it would
i agree with what has been said and ill keep that in mind next time. But also to make it faster, could you also add a break right after you add the element into the set. Because elements in a1 needs to be a substring of at least one of the elements in a2, wouldnt it be best to cut off the for-loop and go on with the next word in a1?
im new to coding and im curious, i like to make my code as optimal as possible :)