@@ -0,0 +1,1048 @@
+# Definition for singly-linked list.%0A# class ListNode(object):%0A#     def __init__(self, x):%0A#         self.val = x%0A#         self.next = None%0A%0Aclass Solution(object):%0A    def oddEvenList(self, head):%0A        %22%22%22%0A        :type head: ListNode%0A        :rtype: ListNode%0A        %22%22%22%0A        %0A        if head == None:%0A            return None%0A        %0A        oddNodes  = %5B%5D%0A        evenNodes = %5B%5D%0A            %0A        node      = head%0A            %0A        while node != None:%0A            oddNodes.append(node)%0A            node = node.next%0A                %0A            if node != None:%0A                evenNodes.append(node)%0A                node = node.next%0A                    %0A        for i, node in enumerate(oddNodes):%0A            node.next = oddNodes%5Bi + 1%5D if i + 1 %3C len(oddNodes) else None%0A            %0A        for i, node in enumerate(evenNodes):%0A            node.next = evenNodes%5Bi + 1%5D if i + 1 %3C len(evenNodes) else None%0A                %0A        oddNodes%5B-1%5D.next = evenNodes%5B0%5D if len(evenNodes) %3E 0 else None%0A    %0A        return oddNodes%5B0%5D%0A

Create solution2.py