Simon AI analyzes numeric signals generated by its products. Given an array of integers and a target value k, determine whether two distinct elements in the array add up to k.
Return True if such a pair exists, or False otherwise. The same array element cannot be used twice, but duplicate values at different indices may form a valid pair.
Implement has_pair_with_sum(nums, k):
nums, a list of integers, and k, an integer target.i and j satisfy nums[i] + nums[j] == k.False.def has_pair_with_sum(nums, k):