Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Python by 21MergeSortedLists ( 7 years ago )
class Solution:
    def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
        if l1 is None:
            return l2
        elif l2 is None:
            return l1
        elif l1.val<=l2.val:
            m=self.mergeTwoLists(l1.next,l2)
            l1.next=m
            return l1
        else:
            m=self.mergeTwoLists(l2.next,l1)
            l2.next=m
            return l2

 

Revise this Paste

Your Name: Code Language: