• + 0 comments

    Simplest Py3 solution:

    def removeDuplicates(self,head):
            if head is None:
                return head
                
            start = head
            curr = head
            
            while curr.next is not None:
                if curr.next.data == curr.data:
                    curr.next = curr.next.next
                else:
                    curr = curr.next
                    
            return start