C++✅✅|| Easy Solution using Hashmap || #TryitHindi
Approach\n Describe your approach to solving the problem. \nDekho yrr simple si approach hai, pahle map me freq count karo and alternate arrays me check karlo j
# Approach\n<!-- Describe your approach to solving the problem. -->\nDekho yrr simple si approach hai, pahle map me freq count karo and alternate arrays me check karlo jiski count 0 wo tumhare kaam ka. \nAdd karo apne answer me and then return karo answer.\nHan ye dhyaan rahe ki repetitions avoid karne parenge.\nAchi lage to UPVOTE kardo.\n\n# Code\n```\nclass Solution {\npublic:\n    vector<vector<int>> findDifference(vector<int>& nums1, vector<int>& nums2) \n    {\n        unordered_map<int, int>mpp1,mpp2;\n        for(auto it: nums1)\n            mpp1[it]++;\n        for(auto it : nums2)\n            mpp2[it]++;\n        vector<vector<int>>answer(2);\n        //check in nums1 if freq in mpp2 == 0, then push it to answer[0]\n        //also set the mpp1[i]= -1 so that repetitions in nums1 do not count; \n        for(auto i: nums1){\n            if(mpp1[i]!=-1 && mpp2.count(i)==0)\n                answer[0].push_back(i);\n            mpp1[i]=-1;\n        }\n        for(auto i: nums2){\n            if(mpp2[i]!=-1 && mpp1.count(i)==0)\n                answer[1].push_back(i);\n            mpp2[i]=-1;\n        }\n\n        return answer; \n    }\n};\n```\n![upvote.jpg](https://assets.leetcode.com/users/images/9129e6fe-b220-4a8c-a049-c203b4879de6_1692813388.570648.jpeg)\n
['Array', 'Hash Table', 'C++']