83. Remove Duplicates from Sorted List

Posted PirateLHX

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了83. Remove Duplicates from Sorted List相关的知识,希望对你有一定的参考价值。

class Solution(object):
    def deleteDuplicates(self, head):
        """
        :type head: ListNode
        :rtype: ListNode
        """
        tmp=head
        while tmp:
            while tmp.next and tmp.next.val==tmp.val:
                tmp.next=tmp.next.next
            tmp=tmp.next
        return head
        

  

以上是关于83. Remove Duplicates from Sorted List的主要内容,如果未能解决你的问题,请参考以下文章

83. Remove Duplicates from Sorted List

83. Remove Duplicates from Sorted Listeasy

83. Remove Duplicates from Sorted List

83. Remove Duplicates from Sorted List

LeetCode 83. Remove Duplicates from Sorted List

LC_83. Remove Duplicates from Sorted List