Simple sorting solution. With maths.
We have to basically find the outlier. \n\nWe assume every element is outlier and map the array. \n\nThe remaining portion has two things. Sum of the array and 
We have to basically find the outlier. \n\nWe assume every element is outlier and map the array. \n\nThe remaining portion has two things. Sum of the array and the array itself. So, it\'ll be 2*(the element which is the sum of the array)\n\ntotal_sum = 2*x + y\n\nx is the sum of the array that we are given \ny is the outlier\n\nby this we can say that:\nx = (total_sum-y)/2\n\n# Code\n```python3 []\nclass Solution:\n    def getLargestOutlier(self, nums: List[int]) -> int:\n        total=sum(nums)\n        hMap = defaultdict(int)\n        # To get the largest we will just sort in descending.\n        nums=sorted(nums, reverse=True)\n        for num in nums:\n            hMap[num]+=1\n        for num in nums:\n            if (total-num)%2!=0:\n                continue\n            hMap[num]-=1\n            if (total-num)//2 in hMap and hMap[(total-num)//2]>0:\n                return num\n            hMap[num]+=1\n        return -1\n\n# total - cur = 2*x => x = (total-cur)/2\n```
['Python3']