Easy Code using Multiset
Code\ncpp []\nclass Solution {\npublic:\n    int getLargestOutlier(vector<int>& nums) {\n        int sum = 0;\n        for (int it : nums) {\n            sum +=
# Code\n```cpp []\nclass Solution {\npublic:\n    int getLargestOutlier(vector<int>& nums) {\n        int sum = 0;\n        for (int it : nums) {\n            sum += it;\n        }\n        multiset<int> st(nums.begin(), nums.end());\n        int maxi = INT_MIN;\n        for (int it : nums) {\n            if ((sum - it) % 2 == 0) {\n                st.erase(st.find(it));\n                int p = (sum - it) / 2;\n                if (st.find(p) != st.end()) {\n                    maxi = max(maxi, it);\n                }\n                st.insert(it);\n            }\n        }\n        return maxi;\n    }\n};\n```
['C++']