@@ -0,0 +1,1111 @@
+'''%0AMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together %0Athe nodes of the first two lists.%0A'''%0A%0A# Definition for singly-linked list.%0A# class ListNode:%0A#     def __init__(self, x):%0A#         self.val = x%0A#         self.next = None%0A%0Aclass Solution:%0A    # @param %7BListNode%7D l1%0A    # @param %7BListNode%7D l2%0A    # @return %7BListNode%7D%0A    def mergeTwoLists_1(self, l1, l2):%0A        if not l1: return l2%0A        if not l2: return l1%0A        %0A        dummy1 = ListNode(0)%0A        pre = dummy1 %0A        %0A        while l1 and l2:%0A            if l1.val %3C l2.val:%0A                pre.next = l1%0A                l1 = l1.next%0A            elif l1.val %3E= l2.val:%0A                pre.next = l2 %0A                l2 = l2.next%0A            pre = pre.next%0A        %0A        if l1:%0A            pre.next = l1%0A%0A        if l2:%0A            pre.next = l2%0A %0A        return dummy1.next%0A        %0A        %0A    def mergeTwoLists(self, a, b):%0A        if a and b:%0A            if a.val %3E b.val:%0A                a, b = b, a%0A            a.next = self.mergeTwoLists(a.next, b)%0A        return a or b%0A

Create Merge_two_sorted_lists.py