Simple solution
Intuition\n\n\n# Approach\n\n\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(n)\n\n# Code\n\nclass Solution {\npublic:\n    int minimumAd
# Intuition\n\n\n# Approach\n\n\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumAddedInteger(vector<int>& nums1, vector<int>& nums2) {\n        sort(nums2.begin(), nums2.end());\n        int min_2 = nums2[0];\n\n        int res  = 1000;\n        for (int i = 0; i < nums1.size(); i++)\n        {\n            for (int j = i+1; j < nums1.size(); j++)\n            {\n                vector<int> arr;\n                for (int k = 0; k < nums1.size(); k++)\n                {\n                     if (k == i || k == j)\n                     {\n                        continue;\n                     }\n                     arr.push_back(nums1[k]);\n                }\n\n                sort(arr.begin(), arr.end());\n\n                int diff = min_2 - arr[0];\n                bool match = true;\n                for (int k = 1; k < arr.size(); k++)\n                {\n                    if (arr[k] != (nums2[k] - diff))\n                    {\n                        match = false;\n                        break;\n                    }\n                }\n\n                if (match)\n                {\n                    if (diff < res)\n                    {\n                        res = diff;\n                    }\n                }\n            }\n        }\n\n        return res;\n    }\n};\n```
['C++']