Easy C++ using sets
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# Co
# 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>& A, vector<int>& B) {\n        int n = A.size();\n\n        unordered_set<int> set1(A.begin(), A.end());\n        unordered_set<int> set2(B.begin(), B.end());\n        unordered_set<int> set;\n\n        for(int i : A) set.insert(i);\n        for(int i : B) set.insert(i);\n        \n        int max_s1 = min(n/2, (int)set1.size());\n        int max_s2 = min(n/2, (int)set2.size());\n        return min((int)set.size(), max_s1 + max_s2);\n    }\n};\n```
['C++']