Your question is Python Coding to Find Numbers. 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.
Cognite Data Fusion can expose large collections of numeric telemetry readings. Given a list of integer readings and a target value, return every distinct unordered pair of values whose sum equals the target.
Each pair must be represented as [smaller, larger], including pairs containing the same value, such as [3, 3]. Return the pairs sorted lexicographically. Duplicate readings must not create duplicate pairs.
Implement a function that accepts nums, a list of integers, and target, an integer. Return a list of two-element integer lists. Every returned pair [a, b] must satisfy a <= b and a + b == target. Return [] when no valid pair exists.
def distinct_sum_pairs(nums, target):