2 pointers
\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        \n        sort(nums.begin() , nums.end());\n        int i = 0 , j = nums.size()-1;\n
```\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        \n        sort(nums.begin() , nums.end());\n        int i = 0 , j = nums.size()-1;\n        for(int k = 0 ; k < nums.size() ; k++){\n            if(-nums[i] == nums[j]) return nums[j];\n            else if(-nums[i] > nums[j]) i++;\n            else j--;\n        }\n        return -1;\n    }\n};\n```
['C++']