```
class Solution {public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode preheader(-1), *p = &preheader;
if ( !l1 ) return l2;
if ( !l2 ) return l1;
while( l1 || l2 ){
if ( l2 -> val < l1 -> val )
{ //p -> next = new ListNode(l2 -> val);
p -> next = l2;
l2? l2 = l2 -> next:0;
p = p -> next;
}
else {
// p -> next = new ListNode(l1 -> val);
p -> next= l1;
l1?l1 = l1 -> next:0;
p = p -> next;
}
}
return preheader.next;
}};
```