easy and beginer solution
Code


# Code
```cpp []
class Solution {
public:
    int getLargestOutlier(vector<int>& nums) {
        
        int n=nums.size();
       long long sum=0;
       map<int,int>mpp;
        for(int i=0;i<n;i++)
        {
            sum+=nums[i];
            mpp[nums[i]]++;
        }
         
         int ans=INT_MIN;
        for(int i=0;i<n;i++)
        {
            int rest=(sum-nums[i]);
            if(rest%2!=0)continue;
            rest=rest/2;
            if(mpp.find(rest)!=mpp.end())
            {
                if(nums[i]==rest && mpp[rest]==1)
                continue;
                else if (nums[i]>ans)
                ans=nums[i];
            }
        } 
        return ans;
    }
};
```
['Array', 'Hash Table', 'Counting', 'Enumeration', 'C++']