public ListNode deleteDuplicates(ListNode head) {
		ListNode cur = head, pre = null;
		while(cur != null) {
			boolean delete = false;
			while(cur.next != null) {
				if(cur.val == cur.next.val) {
					cur.next = cur.next.next;
					delete = true;
				} else break;
			}
			if(delete) {
				if(pre != null) pre.next = cur.next;	
				if(head == cur) head = cur.next;
			} else {
				pre = cur;
			}
			cur = cur.next;
		}
		return head;
	}