Straight forward Python Solution

  • 0
    def oddEvenList(head):
        if not head or not
            return head
        odd = head
        dummy = even = ListNode(-1)
        while odd and and
            nextEven =
   = nextEven
            odd =
            even =
            = =
        return head

Log in to reply

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