在 linklist 中移除重複的 node
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
ListNode* cur = head;
while(cur && cur->next){
if(cur->val == cur->next->val) cur->next = cur->next->next;
else cur = cur->next;
}
return head;
}
};