ZEBRA TECHNOLOGIES | Off Campus OA (2023) | Problem Find K Pairs with Smallest Sums

Question · Posted Jun 2026

Problem Statement You are given two sorted integer arrays nums1 and nums2, and an integer k. A pair (u, v) consists of one element from nums1 and one element from nums2. Your task is to return the k pairs with the smallest sums. If there are fewer than k possible pairs, return all possible pairs. The result can be returned in any order. Example 1 Input nums1 = [1,7,11] nums2 = [2,4,6] k = 3 Output [[1,2],[1,4],[1,6]] Explanation All possible ...

The full answer & interview discussion are available to premium members.

Log in Create a free account