Your question is Array Addition Equals 10. 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.
For a Luxoft Singapore QA data-validation utility, identify every distinct pair of numbers in an integer array whose sum is exactly 10.
Return each pair as a two-element list [a, b], where a <= b. A pair is included only once by value, even if the same values occur at multiple indices. Each array element may be used at most once for a pair. Return the pairs sorted lexicographically. If no valid pair exists, return an empty list.
Implement find_pairs(nums), where nums is a list of integers. The function returns a list of two-element lists containing all unique pairs whose values sum to 10.
def find_pairs(nums):