Leetcode83
思路
解答
class Solution {
public ListNode deleteDuplicates(ListNode head) {
if(head == null){
return head;
}
ListNode cur = head;
ListNode next = head.next;
while(next != null){
if(next.val == cur.val){
next = next.next;
cur.next = next;
}else{
next = next.next;
cur = cur.next;
}
}
return head;
}
}
Vocabulary
xxxx [KK] : (注意事項)
xxxx [KK] : (注意事項)