Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. # Definition for singly-linked list.
  2. # class ListNode(object):
  3. # def __init__(self, x):
  4. # self.val = x
  5. # self.next = None
  6.  
  7. class Solution(object):
  8. def deleteDuplicates(self, head):
  9. cur = head
  10. while cur:
  11. while cur.next and cur.next.val == cur.val:
  12. cur.next = cur.next.next
  13. cur = cur.next
  14. return head
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement