function ReverseList(pHead)
{
if(pHead===null||pHead.next===null) return pHead;
let pre=null,next=null;
while(pHead!==null){
next=pHead.next;
pHead.next=pre;
pre=pHead;
pHead=next;
}
return pre;
}
function ReverseList(pHead)
{
if(pHead===null||pHead.next===null) return pHead;
let pre=null,next=null;
while(pHead!==null){
next=pHead.next;
pHead.next=pre;
pre=pHead;
pHead=next;
}
return pre;
}