* function ListNode(x){
* this.val = x;
* this.next = null;
* }
*/
/**
*
* @param head ListNode类
* @return ListNode类
*/
function deleteDuplicates( head ) {
// write code here
if(!head || !head.next) return head
let fast = head.next,slow = head
while(fast){
if(fast.val == slow.val){
slow.next = fast.next
fast = fast.next
}else{
slow = slow.next
fast = fast.next
}
}
return head
}
module.exports = {
deleteDuplicates : deleteDuplicates
};