Your question is Target Sum Pair Finding. 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.
Perforce Helix Core tooling may need to identify two numeric change metrics whose combined value matches a requested threshold. Given an array of integers and a target integer, return any pair of distinct elements whose values add up to the target. Return -1 if no such pair exists.
Implement pair_sum(nums, target).
nums, a list of integers, and target, an integer.target, or the integer -1 when no pair exists.def pair_sum(nums, target):