use toSet()
\n# Code\n\nclass Solution {\n    fun findMaxK(nums: IntArray): Int {\n    val numsSet = nums.toSet()\n    var result = -1\n    for (num in nums) {\n        if 
\n# Code\n```\nclass Solution {\n    fun findMaxK(nums: IntArray): Int {\n    val numsSet = nums.toSet()\n    var result = -1\n    for (num in nums) {\n        if (-num in numsSet && num > result) {\n            result = num\n        }\n    }\n    return result\n    }\n}\n```
['Kotlin']