Smallest range from k lists

Write codeHard38 minGoogle style

Your task

You have k sorted ascending integer lists. Find the smallest range [a, b] that includes at least one number from each of the k lists. Return [a, b]. If multiple ranges have the same size, return the one with the smaller a. Constraints: 1 <= k <= 3500, each list 1..50 long, -10^5 <= values <= 10^5.

Examples

smallest_range(lists: list[list[int]]) -> list[int]
Example 1
Inputsmallest_range([[4, 10, 15, 24, 26], [0, 9, 12, 20], [5, 18, 22, 30]])
Output[20, 24]