this.val = x;
this.next = null;
}
function Merge(pHead1, pHead2)
{
// write code here
let cur = new ListNode(-1)
let head = cur
while(pHead1 && pHead2){
if(pHead1.val <= pHead2.val){
head.next = pHead1
head = head.next
pHead1 = pHead1.next
}
else{
head.next = pHead2
head = head.next
pHead2 = pHead2.next
}
}
if(pHead1){
head.next = pHead1
}else{
head.next = pHead2
}
return cur.next
}
module.exports = {
Merge : Merge
};