BEATS 100% || A VERY EASY APPROACH ||BEGINNER FRIENDLY
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```python []\n# Definition for singly-linked list.\n# class ListNode(object):\n#     def __init__(self, val=0, next=None):\n#         self.val = val\n#         self.next = next\nclass Solution(object):\n    def modifiedList(self, nums, head):\n        """\n        :type nums: List[int]\n        :type head: Optional[ListNode]\n        :rtype: Optional[ListNode]\n        """\n        s=set(nums)\n        prev=None\n        t=head\n        while(t!=None):\n            if(t.val in s):\n                if(prev==None):\n                    head=head.next\n                    t=head\n        \n                else:\n                    prev.next=t.next\n                    t=prev.next\n            else:\n                prev=t\n                t=t.next\n        return head\n        \n        \n```
['Python']