function reverse(head){ if(head===null) return head; let pre=null; let cur=head; let next=null while(cur){ next=cur.next; cur.next=pre; pre=cur; cur=next; } head=pre; return head; } function addInList(head1,head2){ if(head1===null) return head2; if(head2===null) return head1; let l1=reverse(head1); ...