Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 222 Bytes

2441. Largest Positive Integer That Exists With Its Negative.md

File metadata and controls

12 lines (10 loc) · 222 Bytes
class Solution:
    def findMaxK(self, nums: List[int]) -> int:

        nums.sort(reverse=True)
        for i in nums:
            if -i in nums:
                return abs(i)

        else:
            return -1