Optimized Counting with Explanation 
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:
        total = sum(nums)
        counter = Counter(nums)    # stores {num: freq}
        res = float('-inf')

        for outlier, freq in counter.items():
            delta = total - outlier

            # stop; should be even 
            if delta % 2 != 0:
                continue

            # generate candidate
            cand = delta // 2

            # alreday seen it
            if cand in counter:
                # ensure cand and outlier are from different indices
                if cand == outlier and freq > 1:
                    res = max(res, outlier)

                # don't need to check index
                elif cand != outlier:
                    res = max(res, outlier)

        return res
```
['Array', 'Hash Table', 'Math', 'Counting', 'Enumeration', 'Python', 'Python3']