Merge N Sorted Lists
Start Timer
0:00:00
Given a list of sorted integer lists, write a function sort_lists
to create a combined list while maintaining sorted order without importing any libraries or using the 'sort'
or 'sorted'
functions in Python.
Example:
Input:
lists = [
[1,2,3,4,5,6],
[2,5,7,8],
[3,9,10,12],
[0,1,2,8]
]
Output:
def sort_lists(lists) -> [0,1,1,2,2,3,3,4,5,5,6,7,8,8,9,10,12]
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments