3501. Delete Nodes From Linked List Present In Array
Array Hash Table Linked List
Problem - Delete Nodes From Linked List Present In Array
Medium
You are given an array of integers nums and the head of a linked list. Return the head of the modified linked list after removing all nodes from the linked list that have a value that exists in nums.
Example 1:
Input: nums = [1,2,3], head = [1,2,3,4,5]
Output: [4,5]
Explanation:
Remove the nodes with values 1, 2, and 3.
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 1051 <= nums[i] <= 105- All elements in 
numsare unique. - The number of nodes in the given list is in the range 
[1, 105]. 1 <= Node.val <= 105- The input is generated such that there is at least one node in the linked list that has a value not present in 
nums. 
Solutions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  |  | 
Submission Stats:
- Runtime: 60 ms (48.37%)
 - Memory: 58.8 MB (22.26%)
 


