Easy C++✅✅  solution using 'unordered_set'
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:O(N)\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 {\npublic:\n    int maximumSetSize(vector<int>& nums1, vector<int>& nums2) {\n        unordered_set<int>s1,s2,s;\n        for(auto v:nums1){\n            s1.insert(v);\n        }\n        for(auto v:nums2){\n            s2.insert(v);\n        }\n        int n = nums1.size()/2;\n        vector<int>a,b;\n        for(auto v:s1){\n            a.push_back(v);\n        }\n        for(auto v:s2){\n            b.push_back(v);\n        }\n        for(auto v : a){\n            if(s1.size()<=n)break;\n            if(s2.find(v)!=s2.end()){\n                s1.erase(v);\n            }\n        }\n        for(auto v : b){\n            if(s2.size()<=n)break;\n            if(s1.find(v)!=s1.end()){\n                s2.erase(v);\n            }\n        }\n        while(s1.size()>n){\n            s1.erase(s1.begin());\n        }\n        while(s2.size()>n){\n            s2.erase(s2.begin());\n        }\n        for(auto v:s1){\n            s.insert(v);\n        }\n        for(auto v:s2){\n            s.insert(v);\n        }\n        return s.size();\n    }\n};\n```
['Ordered Set', 'C++']