Python easy solution

  • 0

    O(n) space solution, easy to write but space can be reduced to O(1).

    def reorderList(self, head):
        if not head or not return 
        L = []
        while head:
            head =
        for i in range(len(L)//2):
            L[i].next = L[len(L)-i-1]
            L[len(L)-i-1].next = L[i+1] 
        L[i+1].next = None

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.