C solution
Code\nc []\n#define maxN 100005\n\nstruct ListNode *modifiedList(int *nums, int numsSize, struct ListNode *head) {\n    int presented[maxN] = {0};\n    for (int
# Code\n```c []\n#define maxN 100005\n\nstruct ListNode *modifiedList(int *nums, int numsSize, struct ListNode *head) {\n    int presented[maxN] = {0};\n    for (int i = 0; i < numsSize; i++) {\n        presented[nums[i]]++;\n    }\n    struct ListNode *dummy = (struct ListNode *)malloc(sizeof(struct ListNode));\n    dummy->next = head;\n    struct ListNode *prev = dummy;\n    struct ListNode *curr = head;\n    while (curr != NULL) {\n        if (presented[curr->val]) {\n            prev->next = curr->next;\n            free(curr);\n            curr = prev->next;\n        } else {\n            prev = curr;\n            curr = curr->next;\n        }\n    }\n    struct ListNode *res = dummy->next;\n    free(dummy);\n    return res;\n}\n```
['C']