Merge k Sorted Lists
Hard
Heap / Priority Queue
Grind 75NeetCode 150marc30
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.

Constraints:

  • k == lists.length
  • 0 <= k <= 104
  • 0 <= lists[i].length <= 500
  • -104 <= lists[i][j] <= 104
  • lists[i] is sorted in ascending order
  • The sum of lists[i].length will not exceed 104