Smallest Range Covering Elements from K Lists
You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists.
Smallest Range Covering Elements from K Lists

You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists.

Example 1:
Input: {"nums":[[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]}
Output: [20, 24]
Input
arr ={"nums":[[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]}

Initialize heap with first elements. Range: [0, 5]

K Sorted Lists
L0

4

10

15

24

26

L1

0

9

12

20

L2

5

18

22

30

Current Range

[0, 5]

size: 5
Best Range

[0, 5]

size: 5
Lists: 3
Variables
No variables to display
DepthFunction Call
Stack empty
0/10