You need to sign in or sign up before continuing.×
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.
Amazingly beautiful. Thank you for creating it!
I do realize that for big lists, creating a set would end up in performance improvement, but for smaller ones isn't creating a set a bit of a downgrade? cause we have to basically add an operation (set(arr)) to the whole thing. Maybe I'm just overthinking this...
Totally agree. It's also possible to use set(arr) too. The complexity will eventually be O(n) compared to quadradic O(n^2) in this solution.
Thanks for the brilliant solution! could anyone say what the time complexity of this is? exponential?
This comment is hidden because it contains spoiler information about the solution
Thanks for the short, elegant answer. I just have one quick question.
When I don't add the line (array = np.array(array)) the testing fails on one of the tests (when the array is [[]] ). Any idea why?