public ListNode merge(ListNode first, ListNode second){
        ListNode dummy = new ListNode(-1);
        ListNode dummyHead = dummy;
        while(first != null && second != null){
            if(first.val < second.val){
                dummy.next = first;
                first = first.next;
            }else{
                dummy.next = second;
                second = second.next;
            }
            dummy = dummy.next;
        }
        dummy.next = first == null ? second : first;
        return dummyHead.next;
    }