8 lines C++ solution.faster than 100% submissions|for beginners.explanation of approach
first make a dummy node and assign its value equals to 0 and its next points to the head of the given linked list.\nalso make a prev node and point it to the du
first make a dummy node and assign its value equals to 0 and its next points to the head of the given linked list.\nalso make a prev node and point it to the dummy node.\n***Always remember that a prev node is always required wherever we have to delete a node or we have to break links and create new links . this thing is very important for beginner coders for developing their intusions in future. That\'s not a rule i have said it on the basis of my coding expirience***.\nThen you have to traverse the linked list so run a while loop.\ncheck that if the two adjacent nodes are equal or not if the two adjacent nodes are equal then traverse trhe linked list upto ehen the adjacent nodes are not identical.\nThen directly connect the link from prev->next to the head->next.\nWhile in other case is the adjacent nodes are not equal then simply traverse the linked list by prev=prev->next.\n\n\n\n\n ListNode* deleteDuplicates(ListNode* head) {\n       \n        ListNode *dummy=new ListNode(0,head);\n           ListNode *prev=dummy;\n            \n            while(head!=NULL){\n           \n            if(head->next!=NULL && head->val==head->next->val){\n                    \n    while(head->next!=NULL && head->val==head->next->val)head=head->next;\n                         \n                       \n                            prev->next=head->next;\n                    }\n                    \n                    else prev=prev->next;\n                           \n                   \n                    head=head->next;\n            }\n            \n            return dummy->next;\n                \n        }\n\t\t\n\t\t\n\t\t//if(you_like_and_understand_my_solution)\n\t\t//{\n\t\t//  please_upvote++;\n\t\t// }\n\t\t\n\t\t/*Guys plz plz plz upvote my solution if you really like and understand it.and if you stuck at any point then feel free to comment*/.
['C', 'C++']