/*
 public class ListNode {
    int val;
    ListNode next = null;

    ListNode(int val) {
        this.val = val;
    }
}
*/
public class Solution {
    public ListNode deleteDuplication(ListNode pHead) {
        if(pHead == null) {
            return null;
        } else if(pHead.next == null) {
            return pHead;
        }
        int val = pHead.val;
        ListNode cur = pHead.next;
        if(cur.val == val) {
            while(cur != null && cur.val == val) {
                cur = cur.next;
            }
            return deleteDuplication(cur);
        } else {
            pHead.next = deleteDuplication(pHead.next);
            return pHead;
        }
    }
}