Your question is Two-Sum K Check. 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.
During Sony BRAVIA firmware validation, two measured values may need to combine to a required calibration value K. Given an integer array and an integer K, determine whether two elements at different positions add up exactly to K.
You may use each array position at most once, but duplicate values at different positions are allowed. 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 sum.i and j such that i != j and nums[i] + nums[j] == k.def has_pair_sum(nums, k):