✅C++✅Explanation ✅Faster than100%
The time complexity of code is O(n1 + n2), where n1 and n2 are the sizes of the input arrays nums1 and nums2 respectively. \n\nThis is because we are iterating 
The time complexity of code is O(n1 + n2), where n1 and n2 are the sizes of the input arrays nums1 and nums2 respectively. \n\nThis is because we are iterating through each element of nums1 and nums2 once to populate the map, and then iterating through each element of nums2 and nums1 once again to append elements to the answer vectors.\n\nThis time complexity is optimal since we must look at every element in both arrays to determine the differences. \n\nThe space complexity is O(n1), where n1 is the size of nums1, since we are storing the elements of nums1 in a map.\n\n# C++ Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> findDifference(vector<int>& nums1, vector<int>& nums2) {\n        int n1 = nums1.size();\n        int n2 = nums2.size();\n        \n        vector<int> ans1;\n        vector<int> ans2;\n        \n        unordered_map<int, int> m;\n        // 1 -> if it is present only in nums1\n        // 2 -> if it is present only in nums2\n        // 3 -> if it is present in both nums1 & nums2\n        // 4 -> after considering that element in \'ans\', so that we have only distinct integers\n        \n        // loop through nums1 and mark all elements as \'1\'\n        for(int i=0; i<n1; i++) {\n            m[nums1[i]] = 1;\n        }\n        \n        // loop through nums2\n        for(int i=0; i<n2; i++) {\n            // if the element is present in nums1\n            if(m[nums2[i]] == 1) {\n                m[nums2[i]] = 3; // mark as \'3\' since it\'s in both arrays\n            }\n            else {\n                // if the element is not present in nums1 or it\'s already been added to ans2\n                if(m[nums2[i]] != 3) {\n                    if (m[nums2[i]] != 2) { // if it\'s not been added to ans2 yet\n                        ans2.push_back(nums2[i]); // add to ans2\n                        m[nums2[i]] = 2; // mark as \'2\' since it\'s only in nums2\n                    }\n                }\n            }\n        }\n        \n        // loop through nums1 again\n        for(int i=0; i<n1; i++) {\n            if(m[nums1[i]] == 1) { // if it\'s only in nums1\n                ans1.push_back(nums1[i]); // add to ans1\n                m[nums1[i]] = 4; // mark as \'4\' so that we don\'t add duplicates next time\n            }\n        }\n        \n        return {ans1, ans2}; // return the two arrays\n    }\n};\n\n```\n\n### ***If you find this helpful, Please Upvote \uD83D\uDD3C , Thank You !***\n\n![Meme Code Run.jpg](https://assets.leetcode.com/users/images/f4cb6249-8d5d-4126-9abe-0f39c0900405_1682308842.2299054.jpeg)
['Hash Table', 'C++']