Find K Pairs with Smallest Sums
Given two sorted arrays nums1 and nums2, find k pairs (u1, v1), (u2, v2), ..., (uk, vk) with the smallest sums.
Find K Pairs with Smallest Sums

Given two sorted arrays nums1 and nums2, find k pairs (u1, v1), (u2, v2), ..., (uk, vk) with the smallest sums.

Example 1:
Input: {"nums1":[1,7,11],"nums2":[2,4,6],"k":3}
Output: [[1,2],[1,4],[1,6]]
Input
arr ={"nums1":[1,7,11],"nums2":[2,4,6],"k":3}

Initialize: nums1=[1,7,11], nums2=[2,4,6], k=3

nums1

1

7

11

0

1

2

nums2

2

4

6

0

1

2

Min Heap (sum, i, j)

3

(0, 0)

Result Pairs

Empty

Heap Size
1
Result Count
0
Variables
No variables to display
DepthFunction Call
Stack empty
0/16