Easy CPP Solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(N)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(N)
# Code
```cpp []
class Solution {
public:
    int maximumSetSize(vector<int>& nums1, vector<int>& nums2) {
        unordered_set<int> s1,s2,c;
        for(int i=0;i<nums1.size();i++)
        {
            s1.insert(nums1[i]);
        }
        for(int i=0;i<nums2.size();i++)
        {
            s2.insert(nums2[i]);
            if(s1.find(nums2[i]) != s1.end())
            {
                c.insert(nums2[i]);
            }
        }
        int n1 = s1.size();
        int n2 = s2.size();
        int n = nums1.size();
        int c1 = c.size();
        return min(min(n1-c1,n/2) + min(n2-c1,n/2)+c1,n);
    }
};
```
['C++']