🏆🔥✅2 different approaches🏆🔥✅
\uD83D\uDE09Don\'t just watch & move away, also give an Upvote.\uD83D\uDE09\n\n# Code(SET)\n\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(
# \uD83D\uDE09Don\'t just watch & move away, also give an Upvote.\uD83D\uDE09\n\n# Code(SET)\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        unordered_set<int> s1(begin(nums1), end(nums1));\n        unordered_set<int> s2(begin(nums2), end(nums2));\n\n        int a=0,b=0;\n        for(auto i:nums1)\n        {\n            if(s2.find(i) != s2.end())\n                a++;\n        }\n\n        for(auto i:nums2)\n        {\n            if(s1.find(i) != s1.end())\n                b++;\n        }\n\n<!-- \u2705Well before returning answer don\'t forget to UPVOTE.\u2705 -->\n        return {a,b};\n    }\n};\n```\n\n# Code(Hash-Map)\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        vector<int> hash1(102,0);\n        vector<int> hash2(102,0);\n\n        for(int i=0; i<size(nums1); i++)\n        {\n            hash1[nums1[i]]++;\n        }\n\n        for(int i=0; i<size(nums2); i++)\n        {\n            hash2[nums2[i]]++;\n        }\n\n        int a=0,b=0;\n        for(int i=0; i<102; i++)\n        {\n            if(hash1[i]>0 && hash2[i]>0)\n            {\n                a+=hash1[i];\n                b+=hash2[i];\n            }\n        }\n\n<!-- \u2705Well before returning answer don\'t forget to UPVOTE.\u2705 -->\n        return {a,b};\n    }\n};\n```\n![Leetcode Upvote_2.jpeg](https://assets.leetcode.com/users/images/990afd9f-bac4-409c-a5c0-1a39cf83f0b9_1702653051.6370103.jpeg)\n
['Hash Table', 'C', 'Python', 'C++', 'Java', 'JavaScript']