Done 🎯|| C++ ✅
Intuition\n Describe your first thoughts on how to solve this problem. \n- Find unique in arr1\n- Find common in both\n- Find unique in arr2\n- Common in both b
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- Find unique in arr1\n- Find common in both\n- Find unique in arr2\n- Common in both but not repeated\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 {\npublic:\n    int maximumSetSize(vector<int>& nums1, vector<int>& nums2) {\n        int cnt = 0;\n        int n = nums1.size();\n        int m = nums2.size();\n        map<int, int> mp1, mp2;\n        for (auto it : nums1)\n            mp1[it]++;\n\n        for (auto it : nums2)\n            mp2[it]++;\n\n       \n        for (auto it : mp1) {\n            if (cnt == (n / 2)) /// unique elem in arr1\n                break;\n            if (mp2.find(it.first) == mp2.end())\n                cnt++;\n        }\n\n        for (auto it : mp1) {\n            if (mp2.find(it.first) == mp2.end())\n                continue;\n        if (cnt == (n / 2)) /// common elem in arr1 && arr2\n            break;\n\n        cnt++;\n        mp2[it.first] = INT_MAX;\n        }\n        int ans=cnt;\n        cnt=0;\n        for(auto it:mp2){\n            if(mp1.find(it.first)==mp1.end())  //uniq in arr2\n            cnt++;\n\n            if(cnt==(n/2))\n            break;\n        }\n\n        for(auto it:mp2){ /// common but not repeated\n            if(mp1.find(it.first)==mp1.end() || mp2[it.first]==INT_MAX)\n            continue;\n\n            if(cnt==(n/2))\n            break;\n\n            cnt++;\n        }\n        return cnt+ans;\n    }\n};\n```
['Array', 'Hash Table', 'Greedy', 'C++']