Hashing | Explained
Idea:
Find total sum = T and a frequency map of numbers
Consider each number as outlier (L) one by one
Sum of special numbers = (T - L) / 2
This is an invalid o
**Idea:**
* Find total sum = T and a frequency map of numbers
* Consider each number as outlier (L) one by one
* Sum of special numbers = (T - L) / 2
* This is an invalid outlier candidate if: 
    * T - L is odd
    * S does not exist in the map
    * S exists but only once, which means S is the same as L, but outlier can't be the same number (i.e. the same index) as the sum of special numbers
* Else this is a valid candidate, find max of all such Ls
>T/S: O(n)/O(n), where n = size(nums)
```java []
public int getLargestOutlier(int[] nums) {
    var max = Integer.MIN_VALUE;
    var map = new HashMap<Integer, Integer>();
    var total = getTotal(nums, map);

    for (var outlier : nums) {
        var diff = total - outlier;
        var specialSum = diff >> 1;

        if (diff % 2 == 0 
         && map.containsKey(specialSum) 
         && (specialSum != outlier || map.get(specialSum) > 1))
            max = Math.max(max, outlier);
    }

    return max;
}

private int getTotal(int[] nums, Map<Integer, Integer> map) {
    var total = 0;
    
    for (var num : nums) {
        total += num;
        map.compute(num, (_, v) -> v == null ? 1 : ++v);
    }
    
    return total;
}
```
***Please upvote if this helps***
['Java']