Intuition
- Using a minHeap to maintain all the values, and poll out.
- The previous solution may meet a MLE. Because the input lists may be a huge count.
- Instead of saving all the values at once, we can only save the head nodes of all the lists. Because there’re sorted listnodes, so the next values can be get using .next function, and we can add it to the heap when poll it’s previous node.
solution
|
|