Karleb
Posted on
#2441. Largest Positive Integer That Exists With Its Negative
/** * @param {number[]} nums * @return {number} */varfindMaxK=function(nums){letk=-1letseen=newSet(nums)for(constnumofnums){if(seen.has(-num)){k=Math.max(k,num)}}returnk};
A very interesting question.
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse