Easy Solution using find function | Beats 100% | C++
Approach\n Describe your approach to solving the problem. \nYou just need to find the number of integers that occur atleast once nums2 for all the integers pres
# Approach\n<!-- Describe your approach to solving the problem. -->\nYou just need to find the number of integers that occur atleast once nums2 for all the integers present in nums1.\n\nTo Implement this I have used 2 for loops first for nums1 and and second for nums2. \nWe iterate through all the elements of nums1 and check if they exist in nums2. Then we repeat the process for nums2.\n\n# Complexity\n- Time complexity:  $$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Space complexity:  $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        int first=0;\n        int second=0;\n        for(auto it:nums1)\n        {\n            auto i = find(nums2.begin(),nums2.end(),it);\n            if(i!=nums2.end()) first++;\n        }\n        for(auto it:nums2)\n        {\n            auto j = find(nums1.begin(),nums1.end(),it);\n            if(j!=nums1.end()) second++;\n        }\n        \n        return {first,second};\n    }\n};\n```
['Array', 'C++']