day09笔记 1.题目描述2.代码构思 1.题目描述 2.代码构思 方法1:一次遍历 class Solution: def deleteDuplicates(self, head: ListNode) -> ListNode: if not head: return cur = head while cur.next: if cur.val == cur.next.val: cur.next = cur.next.next else: cur = cur.next return head