Simple O(N) T and S Java Solution with explanation. 
Intuition:
We need to find the largest number in the array that, when removed,
results in a sum that is evenly divisible by 2.
We achieve this by checking if (s


 Intuition:
 We need to find the largest number in the array that, when removed, 
 results in a sum that is evenly divisible by 2. 
 We achieve this by checking if (sum - num) / 2 exists in the array.

Approach:
1. Calculate the total sum of the array.
2. Use a HashMap to store the frequency of each number.
3. Iterate through each number and check:
   - If removing the number makes the sum even.
   - If (sum - num) / 2 exists in the HashMap.
   - If so, update the largest outlier.
4. Return the largest valid outlier, or -1 if none exists.

 Complexity Analysis:
 - Time complexity: O(n), since we iterate through the array twice.
 - Space complexity: O(n), due to the HashMap storage.

# Code
```java []
class Solution {
    public int getLargestOutlier(int[] nums) {
        HashMap<Integer, Integer> map = new HashMap<>();
        int sum = 0;
        int largestOutlier = Integer.MIN_VALUE;
        for (int num : nums) {
            map.put(num, map.getOrDefault(num, 0) + 1);
            sum += num;
        }
        for (int num : nums) {
            if ((sum - num) % 2 == 0) {
                int target = (sum - num) / 2;
                if (map.containsKey(target)) {
                    map.put(num, map.get(num) - 1);
                    if (map.get(target) > 0) {
                        largestOutlier = Math.max(largestOutlier, num);
                    }
                    map.put(num, map.get(num) + 1);
                }
            }
        }
        return largestOutlier == Integer.MIN_VALUE ? -1 : largestOutlier;
    }
}

['Java']