C++ || Efficient || Short || Easy || Clean || Solution || Beginner Friendly ||
please Upvote, if you Find its Helpful :)\n\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        ListNode* temp=new ListNode(0,
#### *please Upvote, if you Find its Helpful :)*\n```\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        ListNode* temp=new ListNode(0,head);//dummy node\n        ListNode* prev=temp;\n        \n        while(head!=NULL){\n            if(head->next!=NULL && head->val==head->next->val){\n               while(head->next!=NULL && head->val==head->next->val){\n                   head=head->next;\n               }\n                prev->next=head->next;\n            }else{\n                prev=prev->next;\n            }\n            head=head->next;\n        }\n        return temp->next;\n    }\n};\n```
['C', 'Iterator', 'C++']