I have two functions that return lists of results of the same size, and I'm trying to check if the results match. The order in the listings may be different. I am currently using the following function:
lists_are_the_same(List1, List2) -> List1 -- List2 =:= [].
This function subtracts one list from another and checks if the result is empty. The problem is that such a method is very slow, and in my case the lists can be quite large.
Is there a faster way to check if two lists consist of the same elements?
source share