code: def merge_k_lists_1(lists):
      heap = PriorityQueue()
  
      # add all linked lists in the heap
      for node in lists:
          if node is not None:
              heap.push(node)
  
      result = ListNode(-1)
      pointer = result
  
      while not heap.is_empty():
          # in each step remove the min list from the heap
          node = heap.pop()
  
          # add the min list to the result
          pointer.next = node
          pointer = pointer.next
  
          node = node.next
          if node is not None:
              # take the next node from the min list and add it in the heap
              heap.push(node)
  
      return result.next
  
file_path: coding-problems/Linked Lists/merge_k_sorted_ll.py
imports: from ll_helpers import ListNode
  import heapq
label_desc: Use image node_id 1 for calling a global function with example usage: merge_k_lists_1(lists) and returns: result