题目:
题解:
class Solution:def oddEvenList(self, head: ListNode) -> ListNode:if not head:return headevenHead = head.nextodd, even = head, evenHeadwhile even and even.next:odd.next = even.nextodd = odd.nexteven.next = odd.nexteven = even.nextodd.next = evenHeadreturn head