Guidewire policy workflows may need to verify whether two integer values from a claim or policy calculation can combine to a specified threshold. Given an unsorted array of integers and a target integer, return True if two distinct elements sum exactly to the target. Otherwise, return False.
Each array element may be used at most once, so a single value cannot satisfy the requirement by pairing with itself unless it appears at least twice.
Implement has_pair_with_sum(nums, target).
nums, a list of integers, and target, an integer.nums contain values whose sum equals target.def has_pair_with_sum(nums, target):