Hello I want to compare a list to another list in Python where the sequence of the elements doens't matters
eg
list=[1,2,3]
should be equal to list2=[3,2,1]
and equal to list3=[3,1,2]
etc. I want to do it dynamically because I don't know how many elements exist at the list? Is there any quick way to do it? The only way I came up with is to search each list for the elements of the other list but this has O(n^2). Also I cannot sort the list since in my implementation the list are list of list. I just want an answer for the simple version of the problem and then modify it! Can you help me?