Simple Java 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        // Map<Integer,Integer> map1=new HashMap<>();\n        // Map<Integer,Integer> map2=new HashMap<>();\n        // for(int i:nums1){\n        //     map1.put(i,map1.getOrDefault(i,0)+1);\n        // }\n        // for(int i:nums2){\n        //     map2.put(i,map2.getOrDefault(i,0)+1);\n        // }\n        // for(int i:nums1){\n        //     if(map2.containsKey(i)){\n        //         map2.put(i,map2.get(i,0)-1);\n        //         map1.put(i,map1.get(i,0)-1);\n        //         if(map1.get(i)==0){\n        //             map1.remove(i);\n        //         }\n        //         if(map2.get(i)==0){\n        //             map2.remove(i);\n        //         }\n        //     }\n        // }\n        int n=nums1.length;\n        Set<Integer> set1=new HashSet<>();\n        Set<Integer> set2=new HashSet<>();\n        Set<Integer> com=new HashSet<>();\n        for(int i:nums1){\n            set1.add(i);\n        }\n        for(int i:nums2){\n            set2.add(i);\n        }\n        for(int i:set1){\n            if(set2.contains(i)){\n                com.add(i);\n            }\n        }\n        int n1=set1.size(),n2=set2.size(),c=com.size();\n        return Math.min(n,Math.min(n1-c,n/2)+Math.min(n2-c,n/2)+c);\n\n    }\n}\n```
['Java']