Python | Easy
see the Successfully Accepted Submission\n\n# Code\n\nclass Solution:\n    def findMaxK(self, nums: List[int]) -> int:\n        # Initialize a set to store the 
[see the Successfully Accepted Submission](https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/submissions/1247084199/?envType=daily-question&envId=2024-05-02)\n\n# Code\n```\nclass Solution:\n    def findMaxK(self, nums: List[int]) -> int:\n        # Initialize a set to store the absolute values of negative numbers\n        neg_abs = set()\n        \n        # Loop through the numbers and insert the absolute values of negative numbers into the set\n        for num in nums:\n            if num < 0:\n                neg_abs.add(-num)\n        \n        max_k = -1\n        \n        # Iterate through the numbers to find the maximum positive integer\n        for num in nums:\n            # If current number is positive and its absolute value exists in the set\n            if num > max_k and num in neg_abs:\n                max_k = num\n        \n        return max_k\n\n```\n![image](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)
['Python3']