Simple easy cpp solution ✅✅
\n\n# Complexity \n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \
\n\n# Complexity \n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        unordered_map<int,int> m;\n        for(auto x: nums){\n            m[x]++;\n        }\n\n        int ans = -1;\n\n        for(auto x : m){\n            int ele = -x.first;\n            if(m.find(ele) != m.end() ){\n                ans = max(ans,x.first);\n            }\n        }\n\n        return ans;\n    }\n};\n```
['C++']