HASH SET
Key Observation\n1) The final answer will not exceed N. Where N = (n/2) + (n/2) (unique elements of nums1 & nums2).\n2) Common items from s1 & s2 would be consi
# Key Observation\n1) The final answer will not exceed N. Where `N = (n/2) + (n/2)` (unique elements of nums1 & nums2).\n2) Common items from s1 & s2 would be considered only once.\n3) If we have more than `n/2` unique elements in both s1 & s2, we can easily discard them.\n4) Imporatant observation is that we have to return size at the end and hence no need to maintain numbers & calculate result from it.\n# Intuition\n1) **Step-1:** Calculate the number of unique elements in nums1 and nums2.\n2) **Step-2:** Identify the common unique elements between the two arrays.\n3) **Step-3:** Adjust the number of unique elements in each array to ensure that the total does not exceed n.\n# Complexity\n+ **TIME:** O(N)\n+ **SPACE:** O(N)\n# CODE:\n```\nclass Solution {\npublic:\n    // SOL-1: HASH SET -- TC: O(N), SC: O(N).\n    int maximumSetSize(vector<int>& nums1, vector<int>& nums2) \n    {\n        int n = nums1.size();\n\t\t// Step-1: Calculate unique elements in nums1 & nums2 -- O(N).\n        unordered_set<int> s1(nums1.begin(), nums1.end());\n        unordered_set<int> s2(nums2.begin(), nums2.end());\n        \n        // Step-2: Calculate the number of common elements -- O(N).\n        int common = 0;\n        for ( int num : s1 )\n            if ( s2.count(num) )\n                common++;\n        \n        // Step-3: Calculate the answer -- O(1).\n        int ans = 0;\n        ans += min(n / 2, static_cast<int>(s1.size()) - common);\n        ans += min(n / 2, static_cast<int>(s2.size()) - common);\n        ans += common;\n        \n        return min(n, ans);\n    }\n};\n```
['C']