pointer

    [LeetCode] 2441. Largest Positive Integer That Exists With Its Negative (Daily Question)

    문제Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array.Return the positive integer k. If there is no such integer, return -1. 정수 리스트 nums가 주어졌을 때 음수도 들어있는 양수의 최대값을 찾는 문제이다. Example 1:Input: nums = [-1,2,-3,3] Output: 3 Explanation: 3 is the only valid k we can find in the array.Example 2:Input: nums = [-1,10,6,7,-7..