Super Easy and Fast solution C# 
Complexity
Time complexity: O(N)

Space complexity: O(N)
Code

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

- Space complexity: O(N)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class Solution {
    public int MaximumSetSize(int[] nums1, int[] nums2) {
        int n = nums1.Length;
        HashSet<int> arr1 = new HashSet<int>(nums1);
        HashSet<int> arr2 = new HashSet<int>(nums2);
        int count1 = arr1.Count;
        int count2 = arr2.Count;
        foreach(int num in arr1)
        {
            if(!arr2.Contains(num))
            {
                arr1.Remove(num);
            }
        }
        int removed = arr1.Count;
        return Math.Min(count1 + count2 - removed, Math.Min(n / 2, count1) + Math.Min(n / 2, count2));
    }
}
```
![89f26eaf70fa927a79d4793441425859.jpg](https://assets.leetcode.com/users/images/891da116-bb89-4807-86a4-4f278a191ac8_1743077850.152701.jpeg)

['Array', 'Hash Table', 'C#']