Simple and Clean Solution || (Using Hash Table) ✅✅
Code\ncpp []\nclass Solution {\npublic:\n    int getLargestOutlier(vector<int>& nums) {\n        int n=nums.size();\n        unordered_map<int,int> mp;\n       
# Code\n```cpp []\nclass Solution {\npublic:\n    int getLargestOutlier(vector<int>& nums) {\n        int n=nums.size();\n        unordered_map<int,int> mp;\n        int sum=0;\n        for(int i=0;i<n;i++){\n            mp[nums[i]]++;\n            sum+=nums[i];\n        }\n        int ans=INT_MIN;\n        for(int i=0;i<n;i++){\n            if((sum-nums[i])%2==0){\n                mp[nums[i]]--;\n                if(mp[(sum-nums[i])/2]>0){\n                    ans=max(ans,nums[i]);\n                }\n                mp[nums[i]]++;\n            }\n        }\n        if(ans==INT_MIN){\n            return -1;\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'C++']