EASY UNDERSTANDABLE || BEGINAR FRENDLY || JAVA SOLUTION
Intuition\n Describe your first thoughts on how to solve this problem. \nUSING HASH SET\n\n# Approach\n Describe your approach to solving the problem. \n\n\n# C
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nUSING HASH SET\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\n/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode() {}\n *     ListNode(int val) { this.val = val; }\n *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }\n * }\n */\nclass Solution {\n    public ListNode modifiedList(int[] nums, ListNode head) {\n        HashSet<Integer>st=new HashSet<>();\n        for(int i=0;i<nums.length;i++){\n            st.add(nums[i]);\n\n        }\n        ListNode dummy=new ListNode();\n        ListNode current=head;\n        ListNode prev=dummy;\n        while(current!=null){\n        if(st.contains(current.val)){\n            prev.next=current.next;\n        }else{\n            prev.next=current;\n            prev=prev.next;\n        }\n        current=current.next;\n        \n        }\n        return dummy.next;\n    }\n}\n```
['Java']