Simple set solution |  Beginner friendly Solution 😎
Used 2 set and multiset to find the count of same element in other set\n\nTC O(NlogN)\n# Code\n\nclass Solution {\npublic:\n    vector<int> findIntersectionValu
Used 2 set and multiset to find the count of same element in other set\n\nTC O(NlogN)\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        multiset<int> ms1 , ms2;\n        set<int> s1 , s2;\n        for(auto it : nums1){\n            ms1.insert(it);\n            s1.insert(it);\n        }\n        \n        for(auto it : nums2){\n            ms2.insert(it);\n            s2.insert(it);\n        }\n        int cnt = 0 ;\n        for(auto it : s1){\n            cnt+=ms2.count(it);\n        }\n        int cnt1 = 0 ;\n        for(auto it : s2){\n            cnt1+=ms1.count(it);\n        }\n        \n        return {cnt1,cnt};\n        \n    }\n};\n```
['C++']