Python using Dict
IntuitionThere is a special pattern for finding the largest outlier in such an array. By having a quick lookup of the sum of the special numbers, we can iterate
# Intuition
There is a special pattern for finding the largest outlier in such an array. By having a quick lookup of the sum of the special numbers, we can iterate the array and determine the largest outlier.

# Approach
1. map each number to its indices
2. iterate through the array and for each number, find the corresponding sum of special numbers, which is the difference between the total sum of the numbers in the array and the current number divided by 2.
3. First we have to make sure that the there is such a number that equals this sum of special numbers and also the current number should not be equal to this sum unless there are multiple occurrences.
4. If the current number is larger than that largest outlier, update the largest number as the current number.

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(n)

# Code
```python3 []
class Solution:
    def getLargestOutlier(self, nums: List[int]) -> int:
        n = len(nums)
        array_sum = sum(nums)
        largest_outlier = None

        outlier_dict = {}
        for i in range(n):
            curr_num = nums[i]
            if curr_num not in outlier_dict.keys():
                outlier_dict[curr_num] = [i]
            else:
                outlier_dict[curr_num].append(i)

        for i in range(n):
            curr_num = nums[i]
            removed_sum = array_sum - curr_num # => 2 * sum of special nums
            sum_of_special_nums = removed_sum/2
            if sum_of_special_nums in outlier_dict.keys() and (curr_num != sum_of_special_nums or len(outlier_dict[sum_of_special_nums]) > 1):
                if not largest_outlier or curr_num > largest_outlier:
                    largest_outlier = curr_num

        return largest_outlier

```
['Python3']