@@ -0,0 +1,624 @@
+# 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 head%0A    # @return %7BListNode%7D%0A    def reverseList(self, head):%0A        a = %5B%5D%0A        p = head%0A        while p != None:%0A            a.append(p)%0A            p = p.next%0A        if len(a) == 0:%0A            return None%0A            %0A        res = a%5Blen(a) - 1%5D%0A        for i in range(len(a)):%0A            if i != len(a) - 1:%0A                a%5Blen(a) - i - 1%5D.next = a%5Blen(a) - i - 2%5D%0A            else:%0A                a%5B0%5D.next = None%0A        return res%0A

Create RevLinkedList_001.py