🚀🔥Easy Solution🚀🙌    | |   💯98% ✅Green Beats🧠
\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n### 1. Initialize HashSet:\n\nCreate two HashSet objects (s1 and s2).\n### 2. Popu
\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n### 1. Initialize HashSet:\n\nCreate two HashSet objects (s1 and s2).\n### 2. Populate HashSets:\n\nIterate through nums1 and nums2, adding elements to s1 and s2, respectively.\n### 3. Initialize List of Lists:\n\nCreate a List of Lists (lst) to store the results.\n### 4. Create Inner Lists:\n\nCreate two inner lists (lst1 and lst2) from s1 and s2 using the ArrayList constructor.\n### 5. Find Differences:\n\nUse the removeAll method to find the elements that are present in lst1 but not in s2, and the elements present in lst2 but not in s1.\n### 6. Add Inner Lists to Result List:\n\nAdd the modified inner lists (lst1 and lst2) to the result list (lst).\n### 7. Return Result List:\n\nReturn the result list containing the differences between nums1 and nums2.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:  **O(N*M)**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O(N)**\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        HashSet<Integer> s1 = new HashSet<>();\n        HashSet<Integer> s2 = new HashSet<>();\n        \n        for(int ele : nums1){\n            s1.add(ele);   \n        }\n        for(int ele : nums2){\n           s2.add(ele);\n        }\n        \n        List<List<Integer>> lst = new ArrayList<>();\n        List<Integer> lst1 = new ArrayList<>(s1);\n        List<Integer> lst2 = new ArrayList<>(s2);\n        lst1.removeAll(s2);\n        lst2.removeAll(s1);\n        lst.add(lst1);\n        lst.add(lst2);\n        return lst;\n    }\n}\n```\n![WhatsApp Image 2023-12-03 at 12.33.52.jpeg](https://assets.leetcode.com/users/images/14bca837-6731-4327-90cf-1bbabd20c07d_1702039760.9552104.jpeg)\n
['Hash Table', 'Java']