Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Merge k Sorted Lists

XPChallenge Points: 30
levelLevel: Hard

You are given k sorted linked lists. Your task is to merge all of them into one sorted linked list.

Example 1:

Input: lists = [[2,5,7],[1,3,6],[4,8]]

Output: [1,2,3,4,5,6,7,8]

Explanation:

The linked-lists are: 2->5->7 1->3->6 4->8 After merging: 1->2->3->4->5->6->7->8

Example 2:

Input: Input: lists = []

Output: []

Example 3:

Input: lists = [[]]

Output: []

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result