🔢 21. 2 Approaches || Using Counting & Unordered Map || C++ Code Reference !!
\n# \ncpp [Using Count Vector]\n\n    vector<int> intersection(vector<vector<int>>& A) {\n        \n        int k=1001,n=A.size();\n        vector<int>C(k,0),V;
\n# \n```cpp [Using Count Vector]\n\n    vector<int> intersection(vector<vector<int>>& A) {\n        \n        int k=1001,n=A.size();\n        vector<int>C(k,0),V;\n\n        for(auto& v: A)\n            for(auto& x:v)\n                C[x]++;\n\n        for(int i=0;i<k;i++)\n            if(C[i]==n)\n                V.push_back(i);\n        \n        return V;\n    }\n```\n```cpp [Using Map]\n\n    vector<int> intersection(vector<vector<int>>& A) {\n        \n        unordered_map<int,int>m;\n        vector<int>V;\n        int n=A.size();\n\n        for(auto& v: A)\n            for(auto& x:v)\n                m[x]++;\n\n        for(auto& i: m)\n            if(i.second==n)\n                V.push_back(i.first);\n\n        sort(V.begin(),V.end());\n\n        return V;\n    }\n\n```\n\n---\n# *Guy\'s Upvote Pleasee !!* \n![up-arrow_68804.png](https://assets.leetcode.com/users/images/05f74320-5e1a-43a6-b5cd-6395092d56c8_1719302919.2666397.png)\n\n# ***(\u02E3\u203F\u02E3 \u035C)***\n\n\n
['Array', 'Hash Table', 'Design', 'Sorting', 'Counting', 'C++']