Merge two sorted arrays to extract the k smallest pair sums using a heap.
Constraints
Example
# Example 1 >>> k_smallest_pairs([1,7,11], [2,4,6], 3) [[1,2],[1,4],[1,6]] # Example 2 >>> k_smallest_pairs([1,1,2], [1,2,3], 2) [[1,1],[1,1]] # Example 3 >>> k_smallest_pairs([], [1,2,3], 3) []
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints