Brute Force Python Sol.
Code\n\nclass Solution:\n    def maximumSetSize(self, nums1: List[int], nums2: List[int]) -> int:\n        cnt1=Counter(nums1)\n        cnt2=Counter(nums2)\n   
# Code\n```\nclass Solution:\n    def maximumSetSize(self, nums1: List[int], nums2: List[int]) -> int:\n        cnt1=Counter(nums1)\n        cnt2=Counter(nums2)\n        \n        target=len(nums1)//2\n        temp=set()\n        \n        c1,c2=0,0\n        for key,val in cnt1.items():\n            if c1>=target:\n                break\n            if key not in cnt2:\n                c1+=1\n                temp.add(key)\n                \n        for key,val in cnt2.items():\n            if c2>=target:\n                break\n            if key not in cnt1:\n                c2+=1\n                temp.add(key)\n                \n        if c1>c2:\n            for key,val in cnt1.items():\n                if c1>=target:\n                    break\n                if key not in temp:\n                    temp.add(key)\n                    c1+=1\n        \n            for key,val in cnt2.items():\n                if c2>=target:\n                    break\n                if key not in temp:\n                    temp.add(key)\n                    c2+=1\n                    \n        else:\n            for key,val in cnt2.items():\n                if c2>=target:\n                    break\n                if key not in temp:\n                    temp.add(key)\n                    c2+=1\n                    \n            for key,val in cnt1.items():\n                if c1>=target:\n                    break\n                if key not in temp:\n                    temp.add(key)\n                    c1+=1\n                    \n        print(c1,c2)\n        print(temp)\n        return len(temp)\n            \n            \n            \n            \n    \n                \n        \n        \n                \n        \n        \n            \n        \n        \n```
['Python3']