Fast Python solution

  • 0
    class Solution(object):
        def deleteDuplicates(self, head):
            :type head: ListNode
            :rtype: ListNode
            if head is None:
                return head
            node = head
            while node is not None:
                while is not None and node.val ==
                node =
                if node is None:
            return head

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.