End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
x in the array.idx as abs(x) - 1.nums[idx] is positive, negate it to mark that the number x has been seen.nums[idx] is already negative, it means x has been seen before, so add abs(x) to the list of duplicates.