Simple Solution using Frequency Array || C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nUsed a frequency array \n\n# Complexity\n- Time complexity:\nO(N+M)\n\n- 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nUsed a frequency array \n\n# Complexity\n- Time complexity:\nO(N+M)\n\n- Space complexity:\nO(Max(N,M))\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        int x;\n        \n         x=max(*max_element(nums1.begin(),nums1.end()),*max_element(nums2.begin(),nums2.end()) );\n        \n        vector<int> m(x+1,0);\n        vector<int> n(x+1,0);\n\n        for(int i=0;i<nums1.size();i++)\n        {\n            m[nums1[i]]++;\n        }\n        for(int i=0;i<nums2.size();i++)\n        {\n            n[nums2[i]]++;\n        }\n        \n        \n        int c,d;\n        for(int i=0;i<=x;i++)\n        {\n            \n            if(n[i]>=1 && m[i]>=1 )\n            c+=m[i];\n        }\n        for(int i=0;i<=x;i++)\n        {\n            \n            if(n[i]>=1 && m[i]>=1 )\n            d+=n[i];\n        }\n        vector<int>y;\n        y.push_back(c);\n        y.push_back(d);\n        return y;\n    }\n};\n```
['Array', 'C++']