题目:

解答:
class Solution {
public ListNode deleteDuplicates(ListNode head) {
if(head == null){
return head;
}
ListNode index = head;
while(index.next != null){
if(index.next.val == index.val){
index.next = index.next.next;
}else{
index = index.next;
}
}
return head;
}
}
