Skip to content

Practice Smallest Range Covering Elements from K Lists

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#632
LeetCode Problem

Smallest Range Covering Elements from K Lists

Problem Statement

You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists. We define the range [a, b] is smaller than range [c, d] if b - a < d - c or a < c if b - a == d - c.

Source: Smallest Range Covering Elements from K Lists on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]
Output
[20,24]

# Example 2

Input
nums = [[1,2,3],[1,2,3],[1,2,3]]
Output
[1,1]

Constraints

nums.length == k
1 <= k <= 3500
1 <= nums[i].length <= 50
-10^5 <= nums[i][j] <= 10^5
nums[i] is sorted in non-decreasing order.

Related LeetCode Problems

Practice more problems similar to Smallest Range Covering Elements from K Lists.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.