Java || Runtime 10 ms Beats 93.56% Memory 43.6 MB Beats 29.55%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {\n        Set<Integer> set1 = new HashSet<>();\n        Set<Integer> set2 = new HashSet<>();\n        for (int num : nums1) {\n            set1.add(num);\n        }\n        for (int num : nums2) {\n            set2.add(num);\n        }\n        List<Integer> diff1 = new ArrayList<>(set1);\n        diff1.removeAll(set2);\n        List<Integer> diff2 = new ArrayList<>(set2);\n        diff2.removeAll(set1);\n        List<List<Integer>> result = new ArrayList<>();\n        result.add(diff1);\n        result.add(diff2);\n        return result;\n    }\n}\n```
['Java']