← 返回 meta 的题目列表Merge Three Sorted Lists
类型:online_judge
Given three sorted linked lists lists, write a function to merge these three lists into one sorted list and return the merged list. The new list should be made by splicing together all nodes from the three lists.
Example
Example 1:
Input: `lists = [[1, 4, 5], [1, 3, 4], [2, 6]]`
Output: `[1, 1, 2, 3, 4, 4, 5, 6]`
Constraints
The total number of nodes in lists[i] is in the range [0, 50]
-10^4 <= lists[i][j] <= 10^4
lists[i] is sorted in ascending order.
Example
Input
3
1 4 5
1 3 4
2 6