Algorithm · Hudson River Trading · Easy
Problem You are given an integer array nums and an integer target. Decide whether the array contains two elements at different indices whose sum equals target. Return true if such a pair exists; otherwise return false. Function Signature Constraints 0 <= len(nums) <= 10^5 -10^9 <= nums[i] <= 10^9 -10^9 <= target <= 10^9 Examples Example 1 Explanation: nums[0] + nums[1] = 2 + 7 = 9, so a valid pair exists. Example 2 Explanation: nums[1] + nums[2] = 2 + 4 = 6. Example 3…
Checking your access…