Rather than creating a list and sorting it, a more efficient approach would be to utilize a priority queue to pick the node with the smallest value at each iteration. This leads to a time complexity of O(n log k), which is advantageous since k is typically much smaller than n. Below is the Python code for this method: from Queue import PriorityQueue class Solution ( object ) : def mergeKLists ( self , lists ) : head = point = ListNode ( 0 ) q = PriorityQueue ( ) for l in lists : if l : q . put ( ( l . val , l ) ) while not q . empty ( ) : val , node = q . get ( ) point . next = ListNode ( val ) point = point . next node = node . next if node : q . put ( ( node . val , node ) ) return head . next This code initializes a PriorityQueue, and for each list, it inserts the first node into the queue. A while loop then runs until the queue is empty. In each loop iteration, the node with the smallest value is removed from the queue and added to the resulting linked list. If the removed node has a subsequent node, it is also added to the queue. The priority queue organizes the nodes based on their values, ensuring that nodes are extracted in ascending order.