C++ solutions
\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        ListNode* cur_node = head;\n        while (cur_node && cur_node->next) {\
```\nclass Solution {\npublic:\n    ListNode* deleteDuplicates(ListNode* head) {\n        ListNode* cur_node = head;\n        while (cur_node && cur_node->next) {\n            ListNode* next_node = cur_node->next;\n            if (cur_node->val == next_node->val)\n                cur_node->next = next_node->next;\n            else\n                cur_node = next_node;\n        }\n        return head;\n    }\n};\n```
['C', 'C++']