✅ Easy C++ Solution
Code\n\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        sort(nums1.begin(), nums1.end());\n        sor
# Code\n```\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        sort(nums1.begin(), nums1.end());\n        sort(nums2.begin(), nums2.end());\n        unordered_map<int, int> countX;\n        int minPossibleX = INT_MAX;\n        \n        for (int i = 0; i < nums1.size(); i++)\n        {\n            for (int j = 0; j < nums2.size(); j++)\n            {\n                int x = nums2[j] - nums1[i];\n                countX[x]++;\n            }\n        }\n\n        for (auto& [x, count] : countX)\n        {\n            vector<int> transformed(nums1.size());\n            for (int i = 0; i < nums1.size(); i++)\n            {\n                transformed[i] = nums1[i] + x;\n            }\n            sort(transformed.begin(), transformed.end());\n\n            if (canMatchMinusTwo(transformed, nums2))\n            {\n                minPossibleX = min(minPossibleX, x);\n            }\n        }\n        return minPossibleX;\n        }\n        bool canMatchMinusTwo(vector<int>& transformed, vector<int>& nums2)\n        {\n        int i = 0, j = 0, skip = 2;\n        while (i < transformed.size() && j < nums2.size())\n        {\n            if (transformed[i] == nums2[j])\n            {\n                i++;\n                j++;\n            }\n            else\n            {\n                i++;\n                skip--;\n                if(skip < 0)\n                {\n                    return false;\n                }\n            }\n        }\n        return j == nums2.size() && (i - j) <= 2;\n    }\n};\n```
['C++']