Is there a way to remove duplicates arrays in an ArrayList?
I tried to convert the ArrayList into a HashSet and back to remove the duplicate arrays.
But this won't work:
ArrayList<int[]> mylist = new ArrayList<int[]>();
mylist.add(new int[]{1,2});
mylist.add(new int[]{2,2}); // Duplicate
mylist.add(new int[]{2,2}); // Duplicate
Before:
{{1,2},{2,2},{2,2}}
After:
{{1,2},{2,2}}
int[]{2,2}?