Your question is Two-Sum in an Array. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A PlayStation Network service receives an array of integer event values and a target integer k. Determine whether two distinct elements in the array sum exactly to k. The same array element cannot be used twice, but duplicate values at different indices may form a valid pair.
Return True if such a pair exists, otherwise return False.
Implement has_pair_sum(nums, k).
nums, a list of integers, and k, an integer target.i and j satisfy nums[i] + nums[j] == k.def has_pair_sum(nums, k):