Java || Easy and Simplest Approach
Code\njava []\nclass Solution {\n    public ListNode modifiedList(int[] nums, ListNode head) {\n        ListNode dummy = new ListNode(-1);\n        dummy.next =
# Code\n```java []\nclass Solution {\n    public ListNode modifiedList(int[] nums, ListNode head) {\n        ListNode dummy = new ListNode(-1);\n        dummy.next = head;\n\n        ListNode curr = dummy;\n        HashSet<Integer> remNum = new HashSet<>();\n        for(int num : nums){\n            remNum.add(num);\n        }\n        while(curr.next!=null){\n            if(remNum.contains(curr.next.val)){\n                curr.next = curr.next.next;\n            }\n            else{\n                curr = curr.next;\n            }\n        }\n        return dummy.next;\n    }\n}\n```
['Java']