Java Most Easy Solution
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int maximumSetSize(int[] nums1, int[] nums2) \n    {\n       int n=nums1.length;\n\n       Set<Integer>set1=new HashSet<>();\n        Set<Integer>set=new HashSet<>();\n\n       for(int num : nums1)\n       {\n           set.add(num);\n           set1.add(num);\n       }\n       int n1=set1.size();\n       set1.clear();\n\n       for(int num : nums2)\n       {\n           set.add(num);\n           set1.add(num);\n       }\n       int n2=set1.size();\n       int n3=set.size();\n\n       int common=n1+n2-n3;\n\n       int ans=Math.min(n/2 , n1-common);\n       ans=ans+ Math.min(n/2 , n2-common);\n       ans=ans+common;\n\n        return Math.min(ans,n);\n    }\n}\n```
['Ordered Set', 'Java']