Check If a particular list is present in "List of Lists" irrespective of order

Viewed 5233

I have a list of lists like

[[0, 5, 10, -1], [1, 8, 3, 4], [2, 9, 6, 7]]

Now I want to search If the above list of lists contain [8,1,4,3] I simply want to ignore the order of elements. How can I achieve this. ** I tried contains but it fails when the order is different.

Edit: The code I'm using

for(List<Integer> innerSList : PermutaionS_toDraw)
        {int elem_trans = 0;

        if(!Final.contains(innerSList))
        {
        Final.add(PermutaionS_toDraw.get(PermutaionS_toDraw.indexOf(innerSList)));
        }
}
5 Answers
Related