✅✅✅ C++ using Vector || Very Simple and Easy to Understand Solution
Up Vote  if you like the solution\n\n/*\nSimply consider an array of size 1001, then keep on updating each nth index with value of n,\nWhile placing value of n 
<b>Up Vote  if you like the solution\n```\n/*\nSimply consider an array of size 1001, then keep on updating each nth index with value of n,\nWhile placing value of n in array, keep on checking if it has already a number with opposite\nsign is present or not. if present then take it as ans if it greater then prev ans \n*/\nclass Solution {\npublic:\n    int findMaxK(vector<int>& nums) {\n        int ans = -1;\n        vector<int> v(10001, 0);\n        for(auto n: nums){\n            if( v[abs(n)] != 0 && (v[abs(n)] + n == 0) ) ans = max(ans, abs(n));\n            else v[abs(n)] = n;\n        }\n        return ans;\n    }\n};\n```
[]