https://mp.weixin.qq.com/s/Xo1m0q7ic7r2WV9wDO5H9Q
知识点:
public ListNode deleteNode(ListNode head,int val){
if(head.val=val){
return head.next;
}
ListNode pre=head,cur=head.next;
while(cur!=null&&cur.val!=val){
pre=cur;
cur=cur.next;
}
pre.next=cur.next;
return head;
}
原文:https://www.cnblogs.com/vivian-xiaoyun/p/13390669.html