sabse easy approch
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     int val;\n *     ListNode *next;\n *     ListNode() : val(0), next(nullptr) {}\n *     ListNode(int x) : val(x), next(nullptr) {}\n *     ListNode(int x, ListNode *next) : val(x), next(next) {}\n * };\n */\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        if(!head || !head -> next){\n\t\treturn head;\n     }\n        \n        int target = head -> val;\n\n        if(head -> next -> val == target){\n            while(head -> next && head -> next -> val == target){\n               head = head -> next; \n            }\n           \n            head = deleteDuplicates(head -> next); \n        }\n        \n      \n        else{\n            \n            head -> next = deleteDuplicates(head -> next);\n        }\n        return head;\n    }\n    \n};\n```
['C++']