C++ || Easy Video Solution || Faster than 95%
The Video solution for the below code\nhttps://youtu.be/-1rhc_JtG-I\n\n# Code\ncpp []\n/**\n * Definition for singly-linked list.\n * struct ListNode {\n *     
The Video solution for the below code\nhttps://youtu.be/-1rhc_JtG-I\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        ios_base::sync_with_stdio(false);\n        cin.tie(NULL);\n        cout.tie(nullptr);\n        // Note:\n        // We need to remove every element from linked list if that is present in nums\n        unordered_set<int> us;\n        for(auto &num : nums) us.insert(num);\n        ListNode *ans = new ListNode(-1);\n        ListNode *tmpAns = ans;\n        while(head){\n            if(us.find(head->val) == us.end()){\n                ans->next = new ListNode(head->val);\n                ans = ans->next;\n            }\n            head = head->next;\n        }\n        return tmpAns->next;\n    }\n};\n```
['C++']