/**标签:head,ListNode,val,删除,重复,next,lc83,int,curr From: https://blog.51cto.com/u_12550160/6066735
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode deleteDuplicates(ListNode head) {
ListNode curr = head;
while(curr!=null && curr.next!=null){
if(curr.val == curr.next.val){
curr.next=curr.next.next;
}else{
curr = curr.next;
}
}
return head;
}
}