Easy Recursive C++ Approach
In the recursive approach we\'ll first set our base cases that if our head or head -> next is NULL then we simply return the head node as we have either a NULL 
In the recursive approach we\'ll first set our base cases that if our *head* or *head -> next* is *NULL* then we simply return the head node as we have either a *NULL* or a Single Node in the Linked List.\n\nNow,\nIf the value in head Node and the next Node is equal then using a while loop we\'ll shift the head Node forward till the time two adjacent nodes have the same value \n(i.e. till *head -> val == head -> next -> val*).\n```\n/*\nFor example : 1 -> 1 -> 1 -> 2 -> 3 \nInitially our head will point at the first Node containing the value 1.\nAfter going through the loop the head will be pointing at the third Node that again contains 1 but the value of the next Node isn\'t 1 so the loop will terminate .\n*/\n```\nAt the end of the while loop it\'s important to notice that we\'ll currently be on the Node whose value was duplicated so we\'ll call recursion on the next value of head and update our pre-existing head. \n**head = deleteDuplicates(head -> next)**\n\nOtherwise if the value of head and the next node are different we\'ll just simply update our  *head -> next* by calling recursion on it leaving our head Node preserved as it wasn\'t duplicated. \n **head -> next = deleteDuplicates(head -> next)**\n\nFinally we\'ll return the head Node. \n```\nListNode* deleteDuplicates(ListNode* head) {\n        \n\t// Base Case\n    if(!head || !head -> next){\n\t\treturn head;\n     }\n        \n        int flag = head -> val;\n        //If head is found duplicated\n        if(head -> next -> val == flag){\n            while(head -> next && head -> next -> val == flag){\n               head = head -> next; \n            }\n            // Since head node is still the one which was duplicated calling recursion on next Node and updating current head\n            head = deleteDuplicates(head -> next); \n        }\n        \n        // If head isn\'t duplicated\n        else{\n            //Leaving current head preserved and calling recursion from the next Node of list\n            head -> next = deleteDuplicates(head -> next);\n        }\n        return head;\n    }\n\t\n\t/*\n\tif(solution -> understandable){\n\t\tupvote++;\n\t}\n\tPS : This is my first ever answer on leetcode hope you liked it. Please comment for suggestions and feedback :)\n\t*/\n```
['Linked List', 'Recursion', 'C']