class Solution:
def reverseList(self, head: ListNode) -> ListNode:
def helper(head):
if head is None or head.next is None:
return head
ret = helper(head.next)
head.next.next = head
head.next = None
return ret
return helper(head)
# TODO
原文:https://www.cnblogs.com/fengcnblogs/p/13512589.html