simply check for first 3 elements
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```\n#include <vector>\n#include <algorithm>\n#include <climits>\n\nusing namespace std;\n\nclass Solution {\npublic:\n    bool check(vector<int>& nums1, vector<int>& nums2, int x) {\n        int count = 0;\n        for (int i = 0, j = 0; i < nums1.size() && j < nums2.size(); i++) {\n            if (nums1[i] + x != nums2[j]) {\n                count++;\n            } else {\n                j++;\n            }\n        }\n        return count <= 2;\n    }\n\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        sort(nums1.begin(), nums1.end());\n        sort(nums2.begin(), nums2.end());\n\n        int minx = INT_MAX;\n        for (int i = 0; i < min(3, (int)nums1.size()); i++) {\n            int x = nums2[0] - nums1[i];\n            if (check(nums1, nums2, x)) {\n                minx = min(minx, x);\n            }\n        }\n        return minx;\n    }\n};\n\n```
['C++']