Simple Python O(n) Solution


#1

def deleteDuplicates(self, A):
head = A
temp = A
A = A.next
while A!=None:
if temp.val!=A.val:
temp.next = A
temp=A
A = A.next
temp.next = A
return head