# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
#python3解法
class Solution:
def deleteDuplicates(self, head: ListNode) -> ListNode:
'感觉思路最为清晰的解法'
if head == None:
return head
p = head
while p.next:
if p.val == p.next.val:
p.next = p.next.next
else:
p = p.next
return head