The k smallest pair sums
You get two lists of integers, a and b, each sorted in non-decreasing order, and an integer k. A pair takes one position from a and one from b, so there are len(a) * len(b) pairs; equal values at different positions are different pairs. Return the k smallest pair sums a[i] + b[j], in non-decreasing order. k is between 0 and the number of pairs, and values may be negative or repeat.
Aim for about O(k log k): don't build every pair when k is small.
Besides the tests, one large input (1,200 values each, k = 2,000) with a ~150 ms limit (scaled to your device's speed): brute force won't pass.
Examples
smallest_pair_sums([1,7,11], [2,4,6], 3)→[3,5,7]smallest_pair_sums([1,1,2], [1,2,3], 4)→[2,2,3,3]smallest_pair_sums([-3,0,5], [2,2], 6)→[-1,-1,2,2,7,7]