Hashmap: O(n) solution
IntuitionApproachComplexity
Time complexity: O(n)

Space complexity: O(n)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: $$O(n)$$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$O(n)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def getLargestOutlier(self, nums: List[int]) -> int:
        hashmap = dict()
        for num in nums:
            if num not in hashmap:
                hashmap[num] = 0
            hashmap[num] += 1
        total = sum(nums)
        mx = -inf
        for num in nums:
            new_total = total - num
            if new_total%2 == 0 and new_total//2 in hashmap:
                if new_total//2 != num:
                    mx = max(mx,num)
                elif hashmap[num] >= 2:
                    mx = max(mx,num)
        return mx
                
```
['Python3']