LeetCode: 21-Merge Two Sorted Lists 解題紀錄
Last Updated on 2021-01-31 by Clay
題目
Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists.
Example:
Input: l1 = [1,2,4], l2 = [1,3,4]
Output: [1,1,2,3,4,4]
題目輸入兩個已經排序過的 Linked List,而我們要將其『合併』,並回傳同樣排序過的 Linked List。
Read More »LeetCode: 21-Merge Two Sorted Lists 解題紀錄