Best C++ Code (beats 80% in both complexity)
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\n\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        // Create a set for quick lookup\n        unordered_set<int> valuesToRemove(nums.begin(), nums.end());\n        \n        // Create a dummy node to handle edge cases easily\n        ListNode dummy(0);\n        dummy.next = head;\n        ListNode* prev = &dummy;\n        ListNode* curr = head;\n        \n        // Traverse the list\n        while (curr != nullptr) {\n            if (valuesToRemove.find(curr->val) != valuesToRemove.end()) {\n                // If the current node\'s value is in the set, remove the node\n                prev->next = curr->next;\n            } else {\n                // Move the previous pointer forward\n                prev = curr;\n            }\n            // Move the current pointer forward\n            curr = curr->next;\n        }\n        \n        return dummy.next;\n    }\n};\n\n```
['C++']