✅Simple Two Pointer Approach O(N/2) Solution ✅
Intuition\nSum of the positive and negative of the same number is eaual to 0.\n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n-
# Intuition\nSum of the positive and negative of the same number is eaual to 0.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N/2)\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int i=0,j=nums.size()-1;\n        while(i<j){\n            int temp=nums[i]+nums[j];\n\n            if(temp>0)\n                j--;\n            else if(temp<0)\n                i++;\n            else \n                return nums[j];\n        }\n        return -1;\n    }\n};\n```
['Array', 'Two Pointers', 'Sorting', 'C++']