Java Solution
Code


# Code
```java []
class Solution {
    public int getLargestOutlier(int[] nums) {
        HashMap<Integer, Integer> map = new HashMap<>();
        int total = 0;
        for (int n : nums) {
            total += n;
            map.put(n, map.getOrDefault(n, 0) + 1);
        }

        int out = Integer.MIN_VALUE;
        for (int n : nums) {
            int current = n;
            int sum = total - current;
            map.put(current, map.get(current) - 1);
            if ((sum & 1) == 0) {
                int even = sum >> 1;
                if (map.getOrDefault(even, 0) > 0)
                    out = Math.max(out, current);
            }
            map.put(current, map.get(current) + 1);
        }
        return out;
    }
}
```
['Java']