Python (Simple Maths)
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    def recoverArray(self, nums):\n        n = len(nums)\n\n        nums.sort()\n\n        def function(k):\n            res, dict1 = [], Counter(nums)\n\n            for i in nums:\n                if dict1[i] and dict1[i+2*k]:\n                    res.append(i+k)\n                    dict1[i] -= 1 \n                    dict1[i+2*k] -= 1 \n\n            if len(res) == n//2:\n                return res \n\n            return []\n\n        for i in range(n):\n            if (nums[i]-nums[0]) > 0 and (nums[i]-nums[0])%2 == 0:\n                ans = function((nums[i]-nums[0])//2)\n                if ans: return ans\n\n        return []\n```
['Python3']