Merge three lists
Input
[[1,4,5],[1,3,4],[2,6]]
Output
[1, 1, 2, 3, 4, 4, 5, 6]
All lists are merged into one sorted list.
Full lesson preview
Merge k sorted linked lists into one sorted list. Input lists are provided as Python lists of values.
Problem statement
Task
Examples
Input
[[1,4,5],[1,3,4],[2,6]]
Output
[1, 1, 2, 3, 4, 4, 5, 6]
All lists are merged into one sorted list.
Input format
Output format
Constraints
Samples
Input
[[], []]
Output
[]
Two empty lists merge to an empty list.