TheAlgorithms-C/leetcode/src/203.c
2020-05-29 20:23:24 +00:00

15 lines
289 B
C

struct ListNode *removeElements(struct ListNode *head, int val)
{
if (head == NULL)
return NULL;
if (head->val == val)
{
return removeElements(head->next, val);
}
else
{
head->next = removeElements(head->next, val);
}
return head;
}