C++  || Nice Explanations 🥹|| Beats 98.7% ||Simple and Easy to Understand 🫸 🫷
\n# Approach\n\n- Create two frequency array to store the frequency of number of two array . \n-  Iterate over all nums1 and nums2 then store the frequency of e
\n# Approach\n\n- Create two frequency array to store the frequency of number of two array . \n-  Iterate over all nums1 and nums2 then store the frequency of each number .\n- Create vector ans of size 2 as mention in the question.\n- In firt loop itearte another time in nums1 and nums2 , and check if the freq2 and freq1 of the number is appear at least one then incremnt the ans[i] depends on the condtion as mention in the question.\n\n\n# Complexity\n- Time complexity:\n   *O(N)*\n- Space complexity:\n   *O(N)*\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2) {\n        // define ans , and set size to two.\n        vector<int> ans (2);\n        // define two frequency array to stroe the frequecnt of the number \n        int freq1[101]={0} , freq2[101]={0};\n\n        //Iterate over num1 and store the frequecnt of the number \n        for(int & i : nums1)\n            freq1[i]++;\n\n        //Iterate over num2 and store the frequecnt of the number \n        for(int & i : nums2)\n            freq2[i]++;\n        \n       //Iterate over num1 and check is the current number is appears at least once in second array , if yes then increment .\n        for(int &i : nums1)\n            ans[0]+=(freq2[i] >= 1);\n\n       //Iterate over num2 and check is the current number is appears at least once in first array , if yes then increment .\n\n        for(int & i : nums2)\n            ans[1]+=(freq1[i] >= 1);\n        \n\n        return ans;\n        \n    }\n};\n```
['Array', 'Hash Table', 'Counting', 'Iterator', 'C++']