ZEBRA Off Campus Hiring 2023 | Arrays and Sorting method
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. Return the k pairs with the smallest sums. If there are fewer than k possible pairs, return all possible pairs. The pairs 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 Possible pairs and their sums: (1,2) ...
The full answer & interview discussion are available to premium members.
Log in Create a free account