LeetCode 23 Merge K Sorted Lists - Why Naive Fails

The trap

Merge lists one by one. First merge list 0 and list 1, then merge the result with list 2, and so on.

If each list has roughly n/kn/k nodes and total nodes is nn, this takes O(kn)O(kn) time. The first list keeps getting longer, so later merges become expensive.

Can you merge more efficiently?