[C++] Map
Code\n\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        int n = nums1.size(), m = nums2.size(), ans = 
# Code\n```\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        int n = nums1.size(), m = nums2.size(), ans = INT_MAX;\n        map<int, int, greater<int>> m1, m2;\n        for (int i = 0; i < n; i++)\n            m1[nums1[i]]++;\n        for (int j = 0; j < m; j++)\n            m2[nums2[j]]++;\n        for (auto& p : m1)\n        {\n            ans = m2.begin()->first - p.first;\n            bool flag = true;\n            for (auto& q : m2)\n                if (m1[q.first - ans] < q.second)\n                {\n                    flag = false;\n                    break;\n                }\n            if (flag)\n                break;\n        }\n        return ans;\n    }\n};\n```
['Ordered Map', 'C++']