I need to delete all duplicates from my HashMap but those duplicates are the lists inside the HashMap.
For example:
HashMap<Integer, ArrayList<Intteger>> myList = new HashMap<>();
myList.put(0, list0);
myList.put(1, list1);
myList.put(2, list2);
myList.put(3, list3);
myList.put(4, list4);
Now when I display all elements of the HashMap I've got:
0 [1,3]
1 [0,3]
2 [1,3]
3 [1,4]
4 [2,4]
How can I remove array's duplicate? As you can see in this case elements with key 0 and 2 have the same values so I want to remove the duplicate. `