Easy Solution
Complexity\n- Time complexity:O(n)\n n is a length of linked list.\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(m)\n m is a size of nums 
# Complexity\n- Time complexity:O(n)\n n is a length of linked list.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(m)\n m is a size of nums array (because of set).\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    ListNode* modifiedList(vector<int>& nums, ListNode* head) {\n        unordered_set<int> s;\n        for(int i = 0; i<nums.size(); i++){\n            s.insert(nums[i]);\n        }\n\n        ListNode dummy(0);\n        dummy.next = head;\n        ListNode* prev = &dummy;\n        ListNode* cur = head;\n\n        while(cur != NULL){\n            if(s.find(cur->val) != s.end()){\n                prev->next = cur->next;\n                delete cur;\n            }\n            else{\n                prev = cur;\n            }\n            cur = prev->next;\n        }\n\n        return dummy.next;\n    }\n};\n```
['Array', 'Hash Table', 'Linked List', 'C++']