行业知识
力扣细节题:删除链表中的重复元素
2026-11-18 15:12:17
来源:互联网转载
struct ListNode* deleteDuplicates(struct ListNode* head) { if(head==NULL||head->next==NULL) { return head; }struct ListNode*cur=head;while(cur->next){ if(cur->val==cur->next->val) { cur->next=cur->next->next; } else { cur=cur->next; }} return head;} ���意如果判断成功则不能移动当前节点到下一个节点,这样会存在跳节点的情况
上一篇:云梦服务器怎么进去的?
下一篇:斗鱼弹幕服务器怎么样?