Simple
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(2n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunction maximumSetSize(nums1: number[], nums2: number[]): number {\n    const target = nums1.length / 2\n    const set1 = new Set(nums1)\n    const set2 = new Set(nums2)\n    let intersection = 0\n\n    // count intersection nums\n    set1.forEach(n => {\n        if(set2.has(n)) intersection ++\n    })\n\n    // difference nums\n    const count1 = Math.min(set1.size - intersection, target)\n    const count2 = Math.min(set2.size - intersection, target)\n    \n    // intersection\n    const commonCount = Math.min((target - count1) + (target - count2), intersection)\n\n    return count1 + count2 + commonCount;\n};\n```
['TypeScript']