python soln
\nclass Solution:\n    def recoverArray(self, nums: List[int]) -> List[int]:\n        \n        \n        \n        nums.sort()\n        n=len(nums)\n        if
```\nclass Solution:\n    def recoverArray(self, nums: List[int]) -> List[int]:\n        \n        \n        \n        nums.sort()\n        n=len(nums)\n        if n==2:\n            return [(nums[0]+nums[-1])//2]\n        hash={}\n        \n        for x in nums:\n            if x not in hash:\n                hash[x]=0\n            hash[x]+=1\n        mn=nums[0]\n        mx=nums[-1]\n        \n        def check(k,nums,hash1,ans):\n            for i in range(len(nums)):\n                if nums[i] in hash1:\n                    if nums[i]+2*k in hash1:\n                        z=nums[i]+2*k\n                        ans.append((nums[i]+z)//2)\n                        \n                        if hash1[nums[i]]==1:\n                            del hash1[nums[i]]\n                        \n                        else:\n                            hash1[nums[i]]-=1\n                        \n                        if hash1[z]==1:\n                            del hash1[z]\n                        \n                        else:\n                            hash1[z]-=1\n                    else:\n                        break\n                     \n            return len(hash1)==0\n                        \n                        \n                    \n                    \n                    \n        \n        for i in range(1,n):\n                        \n\n            k=nums[i]-nums[0]\n            \n            if k%2==0 and k!=0:\n                ans=[]\n                hash1=hash.copy()\n                if check(k//2,nums,hash1,ans):\n                    return ans\n            \n                        \n                    \n                    \n                    \n                \n            \n        \n        \n        \n        \n```\n
['Python']