✔️ C++ || EXPLAINED || ;]
\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        if (head==NULL || head->next==NULL){\n            return head;\n        }
```\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        if (head==NULL || head->next==NULL){\n            return head;\n        }\n        bool j = false;\n        while (head->next!=NULL && head->val == head->next->val){\n            j = true;\n            head->next = head->next->next;\n        }\n        if (j){\n            head = deleteDuplicates(head->next);\n            return head;\n        }\n        head->next = deleteDuplicates(head->next);\n        return head;\n    }\n};\n```\n![image](https://assets.leetcode.com/users/images/34398cd7-c2e8-4957-8661-69f127428365_1654659184.92216.jpeg)\n
['Linked List', 'C', 'C++']