Fast C++ Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int getLargestOutlier(vector<int>& nums) {\n        int n = nums.size();\n        long long sum = 0;\n        unordered_map<int, int> f;\n        for (int x : nums) {\n            sum += x;\n            ++f[x];\n        }\n        int res = -1001;\n        for (int i = 0; i < n; ++i) {\n            long long newSum = sum - nums[i];\n            --f[nums[i]];\n            if (newSum % 2 == 0) {\n                if (f.find(newSum / 2) != f.end() && f[newSum / 2] > 0) res = max(res, nums[i]); \n            }\n            ++f[nums[i]];\n        }\n        return res;\n    }\n};\n```
['C++']