c++ , diff of every element then check with every element.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\n    bool possible(vector<int>& nums1, vector<int>& nums2, int diff){\n        unordered_map<int,int>um;\n\n        for(int i=0;i<nums1.size();i++){\n            um[nums1[i]+diff]++;\n        }\n        int c=0;\n        // cout<<diff<<" ";\n        for(int i=0;i<nums2.size();i++){\n            auto it=um.find(nums2[i]);\n            if(it!=um.end()){\n                c++;\n                if(it->second==1){\n                    um.erase(it);\n                }else{\n                    um[nums2[i]]--;\n                }\n                // cout<<nums2[i]<<" ";\n            }\n            \n        }\n        // cout<<"\\n";\n        if(c==nums2.size()){\n            return true;\n        }\n\n        return false;\n\n\n    }\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        \n        unordered_map<int,int>um;\n        sort(nums1.begin(),nums1.end());\n        sort(nums2.begin(),nums2.end());\n\n        int ans=INT_MAX;\n        unordered_map<int,int>dif;\n\n        for(int i=0;i<nums1.size();i++){\n            for(int j=0;j<nums2.size();j++){\n                int diff = nums2[j]-nums1[i];\n                dif[diff]++;\n                \n\n\n            }\n        }\n        for(auto it=dif.begin();it!=dif.end();it++){\n            int diff = it->first;\n            unordered_map<int,int>um;\n\n            for(int i=0;i<nums2.size();i++){\n                um[nums2[i]]++;\n            }\n            int c=0;\n            for(int k=0;k<nums1.size();k++){\n                auto it = um.find(nums1[k]+diff);\n                if(it!=um.end()){\n                    if(it->second==1){\n                        um.erase(it);\n                    }else{\n                        it->second--;\n                    }\n                    c++;\n                }\n            }\n\n            if(c==nums2.size()){\n                ans=min(ans,diff);\n            }\n        }\n        \n\n\n        return ans;\n    }\n};\n```
['C++']