nothing to it.
ListNode *deleteDuplicates(ListNode *head) {
if(head==NULL||head->next==NULL)
return head;
ListNode *p=head,*s=NULL;
ListNode *q=head->next;
while(q!=NULL)
{
if (p->val!=q->val)
{
p = q;
q = q->next;
}
else
{
s = q;
q = q->next;
p->next = s->next;
delete s;
}
}
return head;
}