Try all 3 possible cases
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```cpp []\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        int n=nums1.size();\n        int m=nums2.size();\n        for(int k=0;k<3;k++){\n            int temp=nums2[m-1]-nums1[n-1-k];\n            int count=0;\n            int i=0,j=0;\n            while(j<m&&count<3){\n                if(nums1[i]+temp==nums2[j]){\n                    i++,j++;\n                }else{\n                    i++;\n                    count++;\n                }\n            }\n            if(count<3)return temp;\n        }\n        return -1;\n    }\n};\n```
['C++']