beats 95% runtime (java)
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int getLargestOutlier(int[] nums) {
        int total = 0;
        Map<Integer, Integer> map = new HashMap<>();

        for (int n : nums) {
            total += n;
            map.put(n, map.getOrDefault(n, 0) + 1);
        }

        int max = Integer.MIN_VALUE;
        for (int k : map.keySet()) {
            int out = total - 2 * k;

            if (map.containsKey(out)) {
                if (out != k || map.get(out) > 1) {
                    max = Math.max(max, out);
                }
            }
        }

        return max;
    }
}
```
['Java']