LeetCode: 23. Merge k Sorted Lists

Problem: 23. Merge k Sorted Lists

Link: https://leetcode.com/problems/merge-k-sorted-lists/

Difficulty: Hard

Description:

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

Example:

Input:

[
1->4->5,
1->3->4,
2->6
]

Output: 1->1->2->3->4->4->5->6

Solution: 

Language: Swift

Runtime: 116ms
Memory: 25.3MB

Copy to Clipboard