python solution, moving the goalposts and simulate
weekly contest 442 resultIntuitionstart off confusingly, but then I have an idea of simulation. I will treat each number as if they are the sum of all special n
# weekly contest 442 result

![weekly contest 442.PNG](https://assets.leetcode.com/users/images/28e20ef0-65b8-4c70-8e2d-2a844e973fa8_1742703159.11178.png)

# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
start off confusingly, but then I have an idea of simulation. I will treat each number as if they are the sum of all special numbers `take the shot`, then I can use two steps to derive the outlier in this particular case `move the goalpost to match the shot`. Use a hashMap to determine if the identified outlier is inside the input nums. 
now I can use this to extract all the pretential outliers, so return the maximum out of them.
- I imagine the approach to be linear, and then I checked the constraint. linear complexity should be fine👌👍.

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
$$O(n)$$
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
$$O(n)$$
# Code
```python3 []
class Solution:
    def getLargestOutlier(self, nums: List[int]) -> int:
        hashMap = Counter(nums)
        sum_ = sum(nums)
        res = -float('inf')
        for num in nums:
            # pretend num is the sum of all special numbers.
            curSum = sum_ - num # curSum --> num + outlier
            outlier = curSum - num
            if outlier in hashMap and (outlier != num or hashMap[outlier] > 1): # if outlier exists inside nums, update the res
                res = max(res, outlier)
        return res
```
['Python3']