• + 0 comments

    Python 3. My janky cringy solution

    def removeDuplicates(self,head):
            cur= head
            while cur and cur.next:
                while cur.next and cur.data == cur.next.data:
                    cur.next = cur.next.next
                cur = cur.next
    
        return head