← 返回 meta 的题目列表Merge Three Sorted Arrays
类型:online_judge
Merge three sorted integer arrays and remove duplicates to output the final sorted array.
Input
Three lists list1, list2, list3, each sorted in ascending order and containing integers.
Output
A list representing the merged, sorted, and deduplicated result.
Example
Input:
list1 = [1, 2]
list2 = [1, 2, 2, 3]
list3 = [2, 3, 3]
Output: [1, 2, 3]
Note
It is guaranteed that each input list is sorted, and the result should also be in ascending order.
Example
Input
[1, 2]
[1, 2, 2, 3]
[2, 3, 3]