java solution
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```\nclass Solution {\n    public int minimumAddedInteger(int[] nums1, int[] nums2) {\n        Arrays.sort(nums1);\n        Arrays.sort(nums2);\n        Map<Integer, Integer> counts = new HashMap<>();\n        int minAdded = Integer.MAX_VALUE;\n\n        for (int num1 : nums1) {\n            for (int num2 : nums2) {\n                int diff = num2 - num1;\n                counts.put(diff, counts.getOrDefault(diff, 0) + 1);\n            }\n        }\n\n        for (Map.Entry<Integer, Integer> entry : counts.entrySet()) {\n            int diff = entry.getKey();\n            int count = entry.getValue();\n            int[] current = new int[nums1.length];\n            for (int i = 0; i < nums1.length; ++i) {\n                current[i] = nums1[i] + diff;\n            }\n            \n            Arrays.sort(current);\n            \n            if (isPossible(current, nums2)) {\n                minAdded = Math.min(minAdded, diff);\n            }\n        }\n        \n        return minAdded;\n    }\n    \n    private boolean isPossible(int[] nums1, int[] nums2) {\n        int i = 0, j = 0, stepsLeft = 2;\n        while (i < nums1.length && j < nums2.length) {\n            if (nums1[i] == nums2[j]) {\n                i++;\n                j++;\n            } else {\n                i++;\n                stepsLeft--;\n                if (stepsLeft < 0) return false;\n            }\n        }\n        return j == nums2.length && (i - j) <= 2;\n    }\n    \n}\n\n```
['Java']