Explain each steps! || HashMap
IntuitionThe key solution to this question is to figure out the formula:Total Sum = sum(nums) = a element whose value is the sum of all the special numbers + su
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The key solution to this question is to figure out the formula:

Total Sum = sum(nums) = a element whose value is the sum of all the special numbers + sum(sepcial numbers) + outlier
= 2 * the element whose value is the sum of all the special numbers + outlier

Therefore, we can transfer the formula a little to describe the relationship between the ‘sum’ element and outlier:

outlier = Total sum - 2 * the 'sum' element

-------------------
From the question, we could get the other information: special numbers, the sum element, and the outlier must have distinct indices, but may share the same value.

It decides that we should collect the frequency of each elements to make sure that outlier and the sum element are not the same element.

# 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:
        # initalize the sum and num count dictionary
        totalsum = 0
        num_count = defaultdict(int)
        
        # Loop through nums to get the total sum and count dictionary
        for num in nums:
            totalsum += num
            num_count[num] += 1

        # the lower bound is -1000
        result = -1003

        # loop through unique elements to guess the outlier and the sum element
        for num in num_count.keys():
            possi_outlier = totalsum - 2 * num

            if possi_outlier in num_count.keys():
                # possi_outlier and the sum element are not the same
                if possi_outlier != num or num_count[possi_outlier] > 1:
                    result = max(possi_outlier,result)

        return result
```
['Python3']