Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Definition for singly-linked list.
- # class ListNode(object):
- # def __init__(self, x):
- # self.val = x
- # self.next = None
- class Solution(object):
- def deleteDuplicates(self, head):
- cur = head
- while cur:
- while cur.next and cur.next.val == cur.val:
- cur.next = cur.next.next
- cur = cur.next
- return head
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement