diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -9,8 +9,9 @@
 
 class Solution:
     def findMaxK(self, nums: List[int]) -> int:
+        nums = sorted(nums, reverse=True)
         s = set(nums)
-        for i in range(len(nums) + 1):
-            if thisnums[i] in s:
+        for i in range(len(nums)):
+            if 0 - nums[i] in s:
                 return nums[i]
         return -1
