BEAT 96.42% | Shortest, Easiest & Well Explained | To the Point & Beginners Friendly Approach(❤️ω❤️)
\n\n# Welcome to My Coding Family\u30FE(\u2267 \u25BD \u2266)\u309D\nThis is my shortest, easiest & to the point approach. This solution mainly aims for purely 
![Screenshot (12).png](https://assets.leetcode.com/users/images/3bb7baa5-2f79-4921-8a52-ad1a7f44124f_1707999824.8999236.png)\n\n# Welcome to My Coding Family\u30FE(\u2267 \u25BD \u2266)\u309D\n*This is my shortest, easiest & to the point approach. This solution mainly aims for purely beginners so if you\'re new here then too you\'ll be very easily be able to understand my this code. If you like my code then make sure to UpVOTE me. Let\'s start^_~*\n\n**The code is given below(p\u2267w\u2266q)**\n\n# Code\n```\nclass Solution {\npublic:\n    int maximumSetSize(vector<int>& v1, vector<int>& v2) {\n        unordered_set<int>st1,st2,comm;\n        for(auto i:v1)st1.insert(i);\n        for(auto i:v2){\n            if(st1.find(i)!=st1.end()){st2.insert(i);comm.insert(i);}\n            else st2.insert(i);\n        }\n        return min(v1.size(),min(st1.size()-comm.size(),v1.size()/2)+min(st2.size()-comm.size(),v1.size()/2)+comm.size());\n\n// if my code helped you then please UpVOTE me, an UpVOTE encourages me to bring some more exciting codes for my coding family. Thank You o((>\u03C9< ))o\n    }\n};\n```\n\n![f5f.gif](https://assets.leetcode.com/users/images/0baec9b8-8c77-4920-96c5-aa051ddea6e4_1702180058.2605765.gif)\n![IUeYEqv.gif](https://assets.leetcode.com/users/images/9ce0a777-25fd-4677-8ccc-a885eb2b08f0_1702180061.2367256.gif)
['C++']