Beats: 93.99% || C++
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: O(m+n)\nwhere \uD835\uDC5A is the number of elements in nums, and \uD835\uDC5B is the number of nodes in the linked list.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(m)\nwhere \uD835\uDC5A is the number of elements in nums\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\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* modifiedList(vector<int>& nums, ListNode* head) {\n        unordered_set<int> st(nums.begin(),nums.end());\n        ListNode *temp=new ListNode(0,head);\n        for(ListNode *prev=temp;prev->next;){\n            if(st.count(prev->next->val))\n                prev->next=prev->next->next;\n            else    prev=prev->next;\n        }\n        return temp->next;\n     \n    }\n};\n```
['Hash Table', 'Linked List', 'C++']