My Solution Code [ QED ]


#1

public class Solution {
public ListNode deleteDuplicates(ListNode A) {
ListNode current = A;
while(current.next!=null){
if(current.val==current.next.val){
current.next=current.next.next;
}else{
current=current.next;
}
}
return A;
}
}