class Solution:
# 返回ListNode
def ReverseList(self, pHead):
pre,cur=None,pHead
while cur:
temp=pre
pre,cur=cur,cur.next
pre.next=temp
return pre
class Solution:
# 返回ListNode
def ReverseList(self, pHead):
pre,cur=None,pHead
while cur:
temp=pre
pre,cur=cur,cur.next
pre.next=temp
return pre