題目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 看完題目, 以為可以用 LinkedList 這類的東西, 想說 ez ... 結果下面給的 hint Sample 根本就不是那麼一回事啊, 抓頭抓抓抓... /** * Definition for singly-linked list. * */ public class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } 先拿到測試資料 /** * Created by jerry on 2017/9/24. * * Merge two sorted linked lists and return it as a new list. * The new list should be made by splicing together the nodes of the first two lists. */ public class LeetCode21MergeTwoSortedListsTest { private LeetCode21MergeTwoSortedLists sol = new LeetCode21MergeTwoSortedLists(); @Test public void test1() { final ListNode l1 = null; final ListNode l2 = new ListNode(0); ListNode act = sol.mergeTwoLists(l1, l2); Assert.assertEquals(0, act.val); } @Test public void test2() { final ListNode l1 = new ListNod...