Java | hashset  | easy to understand
\n    //Runtime: 5 ms, faster than 100.00% of Java online submissions for Largest Positive Integer That Exists With Its Negative.\n    //Memory Usage: 42.5 MB, 
```\n    //Runtime: 5 ms, faster than 100.00% of Java online submissions for Largest Positive Integer That Exists With Its Negative.\n    //Memory Usage: 42.5 MB, less than 60.00% of Java online submissions for Largest Positive Integer That Exists With Its Negative.\n\t//Time: O(N); Space: O(N)\n    public int findMaxK(int[] nums) {\n\n        Set<Integer> set = new HashSet<>();\n        for (int i = 0; i < nums.length; i++)\n            //if (nums[i] < 0)\n            set.add(nums[i]);\n\n        int res = -1;\n        for (int i = 0; i < nums.length; i++) {\n            if (nums[i] > res && set.contains(-nums[i]))\n                res = nums[i];\n        }\n        return res;\n    }\n\n```
['Ordered Set', 'Java']