Find K Pairs with Smallest Sums
You are given two integer arraysnums1andnums2sorted in ascending order and an integerk.
Define a pair(u,v)which consists of one element from the first array and one element from the second array.
Find the k pairs(u1,v1),(u2,v2) ...(uk,vk)with the smallest sums.
Example 1:
Example 2:
Example 3:
Solution
Last updated