least brain pain beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \nbasically don\'t do anything fancy\n\n# Approach\n Describe your approach to solving th
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nbasically don\'t do anything fancy\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```\nfrom math import inf\n\nclass Solution:\n    def minimumAddedInteger(self, nums1: List[int], nums2: List[int]) -> int:\n        \n        # n1 + x = n2\n        # n1 - n2 = -x\n        # -n1 + n2 = x\n        \n        nums1.sort()\n        nums2.sort()   \n        \n        dists = []\n\n        for n2 in nums2: \n            for n1 in nums1:\n                dists.append(n2-n1)\n\n        dists = sorted(set(dists))\n\n        for d in dists:\n            bucket = nums2[::]\n            contains = [False] * len(nums1)\n\n            for i, n in enumerate(nums1): \n                if n+d in bucket: \n                    idx = bucket.index(n+d)\n                    bucket.pop(idx)\n                    contains[i] = True\n                \n            if sum(contains) >= len(nums1) - 2:\n                return d\n            \n\n\n\n\n         \n```
['Python3']