Merge K Sorted Lists
You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it.
Merge K Sorted Lists

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it.

Example 1:
Input: [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]
Input
arr =[[1,4,5],[1,3,4],[2,6]]

Init lists and heap

List 1

1

4

5

List 2

1

3

4

List 3

2

6

Min Heap (Values)

1

1

2

Result

Null

Variables
No variables to display
DepthFunction Call
Stack empty
0/25