Counter
We get the sum tot of all elements in the array.\n\nThen, for each number n, we check if (tot - n) // 2 exists in the array (using a counter). \n\nNote the spec
We get the sum `tot` of all elements in the array.\n\nThen, for each number `n`, we check if `(tot - n) // 2` exists in the array (using a counter). \n\nNote the special case when `n == (tot - n) // 2`.\n\n**Python 3**\n```python\nclass Solution:\n    def getLargestOutlier(self, nums: List[int]) -> int:\n        cnt, tot, res = Counter(nums), sum(nums), -inf\n        for n in nums:\n            if (tot - n) % 2 == 0 and cnt[(tot - n) // 2] > (n == (tot - n) // 2):\n                res = max(res, n)\n        return res\n```
[]