Java Solution Using HashSet
```\nclass Solution {\n    public List> findDifference(int[] nums1, int[] nums2) {\n        List> ans = new ArrayList<>();\n        HashSet n1 = new HashSet<>()
```\nclass Solution {\n    public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {\n        List<List<Integer>> ans = new ArrayList<>();\n        HashSet<Integer> n1 = new HashSet<>();//Creating a hashset to check the unique elements present in the nums1\n        HashSet<Integer> n2 = new HashSet<>();//Creating a hashset to check the unique elements present in the nums2\n        for (int i = 0; i < nums1.length; i++) {\n            n1.add(nums1[i]);\n        }\n        for (int i = 0; i < nums2.length; i++) {\n            n2.add(nums2[i]);\n        }\n        HashSet<Integer> ans1 = new HashSet<>();\n        for (int i = 0; i < nums2.length; i++) {\n            if (!n1.contains(nums2[i])) ans1.add(nums2[i]);//Adding the unique ans into a hashset so that no number gets repeated\n        }\n        HashSet<Integer> ans2 = new HashSet<>();\n        for (int i = 0; i < nums1.length; i++) {\n            if (!n2.contains(nums1[i])) ans2.add(nums1[i]);//Adding the unique ans into a hashset so that no number gets repeated\n        }\n\t\t//Making lists to enter the ans which is in hashset\n        List<Integer> list1 = new ArrayList<>(ans1);\n        List<Integer> list2 = new ArrayList<>(ans2);\n        ans.add(list2);\n        ans.add(list1);\n        return ans;\n    }\n}
['Java']