Simply Try all Possible ways | C++
\n# Code\n\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2){\n        int mini = 2e9;\n        int n = nums1.size
\n# Code\n```\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2){\n        int mini = 2e9;\n        int n = nums1.size();\n        sort(nums1.begin() , nums1.end());\n        sort(nums2.begin() , nums2.end());\n        for(int i = 0 ; i < n ; i++){\n            for(int j = i+1 ; j < n ; j++){\n                vector<int> nums3;\n                for(int k = 0 ; k < n ; k++){\n                    if(i != k && j != k){\n                        nums3.push_back(nums1[k]);\n                    }\n                }\n                set<int> diffs;\n                for(int k = 0 ; k < n-2 ; k++){\n                    diffs.insert(nums2[k] - nums3[k]);\n                }\n                if(diffs.size() == 1) mini = min(mini , nums2[0] - nums3[0]);\n            }\n        }\n        return mini;\n    }\n};\n\n```
['C++']