← 返回 snapchat 的题目列表Merge N sorted lists into one sorted list
类型:online_judge
Given N lists sorted in non-decreasing order, merge them into one sorted list.
Example
lists = [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]
Assumed constraints
1 <= N <= 1e5
Total elements M = sum(len(li)), 0 <= M <= 2e5
Target complexity: about O(M log N).
Example
Input
lists=[[1,4,5],[1,3,4],[2,6]]
Output
[1,1,2,3,4,4,5,6]