Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Find K Pairs with Smallest Sums
Bookmark
Input
Example 1
Example 2
Example 3
Custom
nums1
=
[1, 7, 11]
,
nums2
=
[2, 4, 6]
,
k
=
3
nums1
nums2
1
7
11
2
4
6
0
1
2
0
1
2
result
pop the smallest sum k times, pushing each row's next pair
algo
master
.
io
Step:
Find the 3 pairs (a, b) with the smallest sums, one value from each sorted array
0 / 14
Input
Example 1
Example 2
Example 3
Custom
nums1
=
[1, 7, 11]
,
nums2
=
[2, 4, 6]
,
k
=
3
0 / 14
nums1
nums2
1
7
11
2
4
6
0
1
2
0
1
2
result
pop the smallest sum k times, pushing each row's next pair
algo
master
.
io
Step:
Find the 3 pairs (a, b) with the smallest sums, one value from each sorted array