-*- coding:utf-8 -*-
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def deleteDuplication(self, pHead):
# write code here
if not pHead or not pHead.next:
return pHead
if pHead.val!=pHead.next.val:
pHead.next=self.deleteDuplication(pHead.next)
else:
head=pHead.next
while( head and head.val==pHead.val ):
head=head.next
pHead=self.deleteDuplication(head)
return pHead