Beginner friendly , 2 pointers , Sorting Approach
Intuition\nMax value required , hence first sorted and for searching 2 pointers\n\n# Approach\nHere , it is required that if in case we have more than 1 number 
# Intuition\nMax value required , hence first sorted and for searching 2 pointers\n\n# Approach\nHere , it is required that if in case we have more than 1 number with +ve and -ve value we need to provide larger number.\n\nHence we first sorted the numbers. Then moving from end p2 (i.e larger value) we take its negative for comparission , if this negative value is lesser than the first value in sorted array(i.e 1st -ve val) example -10 < -7 , then it implies we have a +ve value for which we don\'t have a negative value in array it does not exist . Hence we move our p2 pointer to lesser index.\n\nAnd  vice versa.\n\n# Complexity\n- Time complexity:\nO(n log n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        //[-7,-1,1,6,7,10] \n        //This is how our sorted array look like \n        sort(nums.begin(),nums.end());\n        int p2=nums.size()-1;\n        int p1=0;\n        while(p1<p2){\n            int neg = ~nums[p2]+1;\n            if(nums[p1] == neg){\n                return (nums[p2]);\n            }\n            else if(nums[p1]>neg){\n                p2--;\n            }\n            else{\n                p1++;\n            }\n        }\n        return (-1);\n    }\n};\n```
['C++']