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):