
In a Meta-style coding screen, you are given a list of integers and a target value. Return all unique pairs of values whose sum equals the target.
A pair should be included only once, regardless of ordering. For example, (1, 5) and (5, 1) represent the same pair. If a value must be used twice, it must appear at least twice in the input.
nums — a list of integers, and target — an integer[a, b] such that a + b == target and a <= bExample 1
nums = [1, 5, 7, -1, 5], target = 6[[-1, 7], [1, 5]]1 + 5 = 6 and -1 + 7 = 6. The pair [1, 5] appears once even though 5 occurs twice.Example 2
nums = [3, 3, 3, 3], target = 6[[3, 3]]0 <= len(nums) <= 10^5-10^9 <= nums[i] <= 10^9-10^9 <= target <= 10^9nums = [1, 5, 7, -1, 5], target = 6Output[[-1, 7], [1, 5]]WhyBoth `-1 + 7` and `1 + 5` equal `6`, and duplicate `5` values do not create duplicate output pairs.nums = [3, 3, 3, 3], target = 6Output[[3, 3]]WhyAlthough there are multiple occurrences of `3`, the value pair `[3, 3]` should appear only once.nums = [0, 2, 4, 6, 8], target = 8Output[[0, 8], [2, 6]]WhyThe valid unique pairs are `0 + 8` and `2 + 6`.0 <= len(nums) <= 10^5-10^9 <= nums[i] <= 10^9-10^9 <= target <= 10^9Return unique value pairs onlyEach returned pair must be in ascending orderdef find_target_pairs(nums, target):