忘记了node也要等于他的下一个才行
public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
ListNode node = new ListNode(-1);
ListNode head = node;
while (l1 != null && l2 != null){
if (l1.val >= l2.val){
node.next = l2;
l2 = l2.next;
}else{
node.next = l1;
l1 = l1.next;
}
node = node.next;
}
node.next = l1 == null ? l2 : l1;
return head.next;
}