Leetcode – 23. Merge k Sorted Lists

There are so many ways to solve this problem. Let’s look at some of them: Iterate through all the nodes in all the k lists and dump the values in an array, then sort the array, iterate through the sorted array, generate the linked list and return the head. This obviously doesn’t sound like an efficient algorithm. We can use …

Mohit AthwaniLeetcode – 23. Merge k Sorted Lists