/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
int pre;
struct ListNode* f(struct ListNode* head){
if(!head) return NULL;
if(head->val==pre){
struct ListNode* temp=head->next;
free(head);
return f(temp);
}else{
pre=head->val;
head->next=f(head->next);
}
return head;
}
struct ListNode* deleteDuplicates(struct ListNode* head) {
pre=INT_MAX;
return f(head);
}
标签:pre,head,ListNode,struct,return,next,链表,83,排序
From: https://www.cnblogs.com/llllmz/p/18076245